Interface IScriptBuilder
The script builder used to create a script of commands to apply to the security store at the server.
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Clients.SecurityControl
Assembly: Diffusion.Client.dll
Syntax
public interface IScriptBuilder
Remarks
Each method call on the builder adds a line to the script and then the script may be built using the
ToScript() method which produces a
This builder can be accessed with the Script property.
Methods
Append(IScriptBuilder)
Appends all the operations of a given builder to the current builder.
Declaration
IScriptBuilder Append(IScriptBuilder other)
Parameters
Type | Name | Description |
---|---|---|
IScriptBuilder | other | The builder to append to the current builder. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes all operations of |
RemoveTopicPermissions(String, String)
Removes any previously assigned permissions to a particular topic for a given role.
Declaration
IScriptBuilder RemoveTopicPermissions(string role, string topicPath)
Parameters
Type | Name | Description |
---|---|---|
String | role | The role to remove topic permissions from. |
String | topicPath | The topic for which permissions are to be removed. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also removes the topic permissions for the role at the given point in the topic hierarchy. |
Remarks
This is different from setting no permissions to a topic for a role. By removing permissions set for a particular branch of the topic hierarchy the permissions become deferred to superior branches in the hierarchy or to the default topic permissions.
SetDefaultTopicPermissions(String, IEnumerable<TopicPermission>)
Sets the default topic permissions to be assigned to a named role.
Declaration
IScriptBuilder SetDefaultTopicPermissions(string role, IEnumerable<TopicPermission> permissions)
Parameters
Type | Name | Description |
---|---|---|
String | role | The role. |
IEnumerable<TopicPermission> | permissions | The default permissions to assigned to the role. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes the |
Remarks
The role will have the given permissions to all topics unless specifically overridden for named paths.
SetGlobalPermissions(String, IEnumerable<GlobalPermission>)
Sets the global permissions to be assigned to a named role.
Declaration
IScriptBuilder SetGlobalPermissions(string role, IEnumerable<GlobalPermission> permissions)
Parameters
Type | Name | Description |
---|---|---|
String | role | The role. |
IEnumerable<GlobalPermission> | permissions | The global permissions to assign to the role. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes the |
SetRoleIncludes(String, IEnumerable<String>)
Sets the roles that are to be included within a specified role.
Declaration
IScriptBuilder SetRoleIncludes(string role, IEnumerable<string> includedRoles)
Parameters
Type | Name | Description |
---|---|---|
String | role | The role. |
IEnumerable<String> | includedRoles | The roles to include. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also sets the given role relationship. |
SetRolesForAnonymousSessions(IEnumerable<String>)
Sets the roles to be assigned by default to all anonymous sessions.
Declaration
IScriptBuilder SetRolesForAnonymousSessions(IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | roles | the roles to be assigned to anonymous sessions. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes the given |
SetRolesForNamedSessions(IEnumerable<String>)
Sets the roles to be assigned by default to all named sessions.
Declaration
IScriptBuilder SetRolesForNamedSessions(IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | roles | The roles to be assigned to all named sessions. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes the given |
SetTopicPermissions(String, String, IEnumerable<TopicPermission>)
Sets specific topic permissions to be assigned for a named role.
Declaration
IScriptBuilder SetTopicPermissions(string role, string topicPath, IEnumerable<TopicPermission> permissions)
Parameters
Type | Name | Description |
---|---|---|
String | role | The role. |
String | topicPath | The point in the topic tree at which the permissions are to be applied for the named role. |
IEnumerable<TopicPermission> | permissions | The permissions to assign to the role for the topic. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes the |
Remarks
When permissions are assigned to a role for a topic path they will apply to the topic and any topics below the specified topic in the topic tree. Topic scoped permissions are assigned to roles for specific topic paths. The permission assignment applies to all descendant topics, unless there is a more specific assignment.
To evaluate whether a client session has access to a permission for a topic, the server starts at that topic and searches up the tree to find the nearest permission assignment. The first assignment is the only one considered, even if the client has roles involved in assignments further up the topic tree.
ToScript()
Creates a new script.
Declaration
string ToScript()
Returns
Type | Description |
---|---|
String | The script. |