public static XpandRole GetAnonymousRole(this IObjectSpace objectSpace, string roleName, bool selfReadOnlyPermissions = true) { var anonymousRole = (XpandRole)objectSpace.GetRole(roleName); anonymousRole.Permissions.AddRange(new[] { objectSpace.CreateModifierPermission <MyDetailsOperationPermissionData>(Modifier.Allow), objectSpace.CreateModifierPermission <AnonymousLoginOperationPermissionData>(Modifier.Allow) }); return(anonymousRole); }
public static XpandRole GetAnonymousRole(this IObjectSpace objectSpace, string roleName, bool selfReadOnlyPermissions = true) { var anonymousRole = (XpandRole)objectSpace.GetRole(roleName); anonymousRole.Permissions.AddRange((IEnumerable <XpandPermissionData>) new[] { objectSpace.CreateModifierPermission <MyDetailsOperationPermissionData>(Modifier.Allow), objectSpace.CreateModifierPermission <AnonymousLoginOperationPermissionData>(Modifier.Allow) }); anonymousRole.AddObjectAccessPermission(SecuritySystem.UserType, "[Oid] = CurrentUserId()", SecurityOperations.ReadOnlyAccess); return(anonymousRole); }