public static SecurityPolicyPermission CreateRolePermission(this ISecurityPolicyPermission permission) { SecurityPolicyPermission securityOperationPermission = new SecurityPolicyPermission(); securityOperationPermission.SetValue(permission); return(securityOperationPermission); }
public virtual IPermission SetPermissionPolicy(PermissionPolicy policy) { SecurityPolicyPermission operationPermission = new SecurityPolicyPermission(); switch (policy) { case PermissionPolicy.AllowAllByDefault: operationPermission.Operations = SecurityOperation.FullAccess; break; case PermissionPolicy.ReadOnlyAllByDefault: operationPermission.Operations = SecurityOperation.Read; break; case PermissionPolicy.DenyAllByDefault: break; default: break; } OperationPermissions.Add(operationPermission); return(operationPermission); }
public static void SetValue(this SecurityPolicyPermission operationPermission, ISecurityPolicyPermission permission) { operationPermission.Operations = permission.Operations; }