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 System.String script which may be sent to the server using UpdateStoreAsync(String).

This builder can be accessed with the Script property.

From Diffusion 6.5, script builders are no longer immutable. Each builder operation mutates this script builder and returns it.

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 other.

DeisolatePath(String)

Re-instate inheritance of path permission assignments from parents of the given path.

Declaration
IScriptBuilder DeisolatePath(string path)
Parameters
Type Name Description
System.String path

The path to be deisolated.

Returns
Type Description
IScriptBuilder

This builder, modified to re-instate the inheritance of path permission assignments from parents of the given path.

Remarks

Added in 6.5.

IsolatePath(String)

Set a path not to inherit path permissions from its parent paths or the default path permissions.

Declaration
IScriptBuilder IsolatePath(string path)
Parameters
Type Name Description
System.String path

The path to be isolated.

Returns
Type Description
IScriptBuilder

This builder, modified to isolate the given path in the path hierarchy.

Remarks

By default, a path without specific path permission assignments inherits the permission assignments from the first parent path that has them. If neither the path nor any of its parent paths have permission assignments, the default path permissions are used.

Added in 6.5.

RemovePathPermissions(String, String)

Removes any previously assigned permissions to a particular topic for a given role.

Declaration
IScriptBuilder RemovePathPermissions(string role, string path)
Parameters
Type Name Description
System.String role

The role to remove path permissions from.

System.String path

The path for which permissions are to be removed.

Returns
Type Description
IScriptBuilder

This builder, modified to remove the path permissions for the role at the given point in the topic hierarchy.

Remarks

This is different from setting no path permissions for the path and role. By removing permissions set for a particular branch of the path hierarchy, the permissions become inherited from assignments made against parent paths in the hierarchy or from the default path permissions.

SetDefaultPathPermissions(String, IEnumerable<PathPermission>)

Sets the default path permissions to be assigned to a named role.

Declaration
IScriptBuilder SetDefaultPathPermissions(string role, IEnumerable<PathPermission> permissions)
Parameters
Type Name Description
System.String role

The role.

IEnumerable<PathPermission> permissions

The default permissions to be assigned to the role.

Returns
Type Description
IScriptBuilder

This builder, modified to set the permissions for the given role.

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
System.String role

The role.

IEnumerable<GlobalPermission> permissions

The global permissions to assign to the role.

Returns
Type Description
IScriptBuilder

This builder, modified to set the permissions for the given role.

SetPathPermissions(String, String, IEnumerable<PathPermission>)

Sets specific path permissions to be assigned for a named role.

Declaration
IScriptBuilder SetPathPermissions(string role, string topicPath, IEnumerable<PathPermission> permissions)
Parameters
Type Name Description
System.String role

The role.

System.String topicPath

The point in the topic tree at which the permissions are to be applied for the named role.

IEnumerable<PathPermission> permissions

The permissions to assign to the role for the topic.

Returns
Type Description
IScriptBuilder

This builder, modified to set the permissions for the role at the given point in the topic tree.

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.

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
System.String role

The role.

IEnumerable<System.String> includedRoles

The roles to include.

Returns
Type Description
IScriptBuilder

This builder, modified to set the given role relationship.

SetRoleLockedByPrincipal(String, String)

Restricts a role so it can only be edited by a specific principal.

Declaration
IScriptBuilder SetRoleLockedByPrincipal(string role, string lockingPrincipal)
Parameters
Type Name Description
System.String role

The role.

System.String lockingPrincipal

The locking principal that is able to edit the role.

Returns
Type Description
IScriptBuilder

This builder, modified to lock a role to a single principal that can edit it.

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<System.String> roles

The roles to be assigned to anonymous sessions.

Returns
Type Description
IScriptBuilder

This builder, modified to set the given roles.

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<System.String> roles

The roles to be assigned to all named sessions.

Returns
Type Description
IScriptBuilder

This builder, modified to set the given roles.

ToScript()

Creates a new script.

Declaration
string ToScript()
Returns
Type Description
System.String

The script.

Back to top