Deveel.Data.Sql.Statements.RevokeRoleStatement.ExecuteStatement C# (CSharp) Метод

ExecuteStatement() защищенный Метод

protected ExecuteStatement ( ExecutionContext context ) : void
context ExecutionContext
Результат void
        protected override void ExecuteStatement(ExecutionContext context)
        {
            if (!context.DirectAccess.RoleExists(RoleName))
                throw new StatementException(String.Format("The role '{0}' does not exist", RoleName));
            if (!context.DirectAccess.UserExists(Grantee) &&
                !context.DirectAccess.RoleExists(Grantee))
                throw new StatementException(String.Format("User or role '{0}' does not exist.", Grantee));

            if (!context.User.CanRevokeRole(RoleName))
                throw new SecurityException(String.Format("User '{0}' has no role rights to revoke role '{1}' from '{2'}'.",
                    context.User.Name, RoleName, Grantee));

            if (Admin) {
                // TODO:
                throw new NotImplementedException();
            }

            context.DirectAccess.RemoveUserFromRole(Grantee, RoleName);
        }