Example #1
0
        public async Task <bool> UpdateRoleAsync(IPermissionRole role)
        {
            if (IsRocketModRole(role.Id))
            {
                throw new System.NotSupportedException();
            }

            return(await m_BasePermissionRoleStore.UpdateRoleAsync(role));
        }
Example #2
0
        public RocketPermissionsProviderResult SaveGroup(RocketPermissionsGroup @group)
        {
            var permissionGroup = ConvertToGroup(@group);

            return(AsyncHelper.RunSync(async() =>
            {
                if (await m_PermissionRoleStore.UpdateRoleAsync(permissionGroup))
                {
                    return RocketPermissionsProviderResult.Success;
                }

                return RocketPermissionsProviderResult.UnspecifiedError;
            }));
        }
        public Task <bool> UpdateRoleAsync(IPermissionRole role)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role));
            }

            if (RocketModIntegrationEnabled() && IsRocketModRole(role.Id))
            {
                Task.FromException(new NotSupportedException("Updating RocketMod roles from OpenMod is not supported."));
            }

            return(m_BasePermissionRoleStore.UpdateRoleAsync(role));
        }
Example #4
0
        public RocketPermissionsProviderResult SaveGroup(RocketPermissionsGroup @group)
        {
            if (@group == null)
            {
                throw new ArgumentNullException(nameof(@group));
            }

            var permissionGroup = ConvertToGroup(@group);

            return(AsyncHelper.RunSync(async() =>
            {
                if (await m_PermissionRoleStore.UpdateRoleAsync(permissionGroup))
                {
                    return RocketPermissionsProviderResult.Success;
                }

                return RocketPermissionsProviderResult.UnspecifiedError;
            }));
        }