示例#1
0
        public bool Revoke(string clusterName, Common.Security.Impl.ResourceId resourceId, string userName, string roleName)
        {
            bool isSuccessful = false;

            isSuccessful = _session.Revoke(clusterName, resourceId, userName, roleName);
            return(isSuccessful);
        }
示例#2
0
 public bool Revoke(string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser user, Common.Security.Interfaces.IRole role)
 {
     if (ConfigurationServer != null)
     {
         return(ConfigurationServer.RevokeRoleOnDatabaseServer(shardName, resourceId, user, role));
     }
     return(true);
 }
示例#3
0
 public bool Grant(string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser user, Common.Security.Interfaces.IRole role)
 {
     if (ConfigurationServer != null)
     {
         return(ConfigurationServer.GrantRoleOnDatabaseServer(shardName, resourceId, user, role));
     }
     return(true); //returns true as the call was meant to be sent to db server from config server for granting role and it is already on db server
 }
        public bool RevokeRole(string cluster, string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser userInfo, Common.Security.Interfaces.IRole roleInfo)
        {
            ManagementCommand command = GetManagementCommand(ConfigurationCommandUtil.MethodName.Revoke);

            command.Parameters.AddParameter(cluster);
            command.Parameters.AddParameter(shardName);
            command.Parameters.AddParameter(resourceId);
            command.Parameters.AddParameter(userInfo);
            command.Parameters.AddParameter(roleInfo);
            return((bool)ExecuteCommandOnMgtServer(command, true));
        }
示例#5
0
 public bool RevokeRole(string cluster, string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser userInfo, Common.Security.Interfaces.IRole roleInfo)
 {
     try
     {
         return(dbMgtServer.RevokeRole(cluster, shardName, resourceId, userInfo, roleInfo));
     }
     catch (System.Exception exc)
     {
         throw exc;
     }
 }
示例#6
0
 public bool Grant(string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser userInfo, Common.Security.Interfaces.IRole roleInfo)
 {
     try
     {
         if (_configurationSession != null)
         {
             return(_configurationSession.Grant(this.ClusterName, resourceId, userInfo.Username, roleInfo.RoleName));
         }
         return(false);
     }
     catch (ChannelException)
     {
         return(false);
     }
 }
示例#7
0
 public bool IsAuthorized(Common.Security.Interfaces.ISessionId sessionId, Common.Security.Impl.ResourceId resourceId, Common.Security.Impl.ResourceId superResourceId, Common.Security.Impl.Permission operationPermission)
 {
     try
     {
         if (_configurationSession != null)
         {
             resourceId.Name = ClusterName.ToLower() + "/" + resourceId.Name;
             return(_configurationSession.IsAuthorized(sessionId, resourceId, superResourceId, operationPermission));
         }
         return(false);
     }
     catch (ChannelException)
     {
         return(false);
     }
 }
示例#8
0
 public bool Revoke(string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser userInfo, Common.Security.Interfaces.IRole roleInfo)
 {
     return(true);
 }
示例#9
0
 public bool IsAuthorized(ISessionId sessionId, Common.Security.Impl.ResourceId resourceId, Common.Security.Impl.ResourceId superResourceId, Common.Security.Impl.Permission operationPermission)
 {
     return(false);
 }