Esempio n. 1
0
 public bool CreateUser(Common.Security.Interfaces.IUser user)
 {
     if (LoggerManager.Instance.SecurityLogger != null && LoggerManager.Instance.SecurityLogger.IsDebugEnabled)
     {
         LoggerManager.Instance.SecurityLogger.Debug("ConfigSecurityServer.CreateUser", "Create user '" + user.Username + "'");
     }
     try
     {
         if (_configurationSession != null)
         {
             return(_configurationSession.CreateUser(user));
         }
         return(false);
     }
     catch (ChannelException)
     {
         return(false);
     }
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
0
 public bool Revoke(string shardName, Common.Security.Impl.ResourceId resourceId, Common.Security.Interfaces.IUser userInfo, Common.Security.Interfaces.IRole roleInfo)
 {
     return(true);
 }
        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));
        }
Esempio n. 5
0
 public bool DropUser(Common.Security.Interfaces.IUser user)
 {
     return(true);
 }
Esempio n. 6
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;
     }
 }
Esempio n. 7
0
 public bool DropUser(Common.Security.Interfaces.IUser userInfo)
 {
     return(_session.DropUser(userInfo));
 }
Esempio n. 8
0
 public bool CreateUser(Common.Security.Interfaces.IUser userInfo)
 {
     return(_session.CreateUser(userInfo));
 }
Esempio n. 9
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);
 }
Esempio n. 10
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
 }