/// <summary> /// load the groups of the given user /// </summary> /// <param name="AUserID"></param> /// <returns></returns> public static SUserGroupTable LoadUserGroups(String AUserID) { SUserGroupTable ReturnValue; TDBTransaction ReadTransaction; Boolean NewTransaction = false; try { ReadTransaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.Serializable, out NewTransaction); if (SUserGroupAccess.CountViaSUser(AUserID, ReadTransaction) > 0) { ReturnValue = SUserGroupAccess.LoadViaSUser(AUserID, ReadTransaction); } else { ReturnValue = new SUserGroupTable(); } } finally { if (NewTransaction) { DBAccess.GDBAccessObj.CommitTransaction(); TLogging.LogAtLevel(9, "TGroupManager.LoadUserGroups: committed own transaction."); } } return ReturnValue; }
/// <summary> /// constructor /// </summary> /// <param name="AIdentity"></param> /// <param name="AGroups"></param> /// <param name="AUserTableAccessPermissions"></param> /// <param name="AModuleAccess"></param> /// <param name="AFunctions"></param> /// <param name="ARoles"></param> public TPetraPrincipal(System.Security.Principal.IIdentity AIdentity, SUserGroupTable AGroups, SUserTableAccessPermissionTable AUserTableAccessPermissions, String[] AModuleAccess, String[] AFunctions, String[] ARoles) : base() { if (AIdentity == null) { throw new ArgumentNullException("AIdentity", "Argument must not be null"); } FIdentity = AIdentity; FGroupsDT = AGroups; FUserTableAccessPermissionDT = AUserTableAccessPermissions; FModuleAccess = AModuleAccess; FFunctions = AFunctions; FRoles = ARoles; // Prepare Arrays for fast BinarySearch if (FModuleAccess != null) { System.Array.Sort(FModuleAccess); } if (FRoles != null) { System.Array.Sort(FRoles); } if (FFunctions != null) { System.Array.Sort(FFunctions); } // Default LoginMessage is not defined FLoginMessage = null; }
/// <summary> /// constructor /// </summary> /// <param name="AIdentity"></param> /// <param name="AGroups"></param> /// <param name="AModuleAccess"></param> /// <param name="AFunctions"></param> /// <param name="ARoles"></param> public TPetraPrincipal(System.Security.Principal.IIdentity AIdentity, SUserGroupTable AGroups, String[] AModuleAccess, String[] AFunctions, String[] ARoles) : this(AIdentity, AGroups, null, AModuleAccess, AFunctions, ARoles) { }
/// <summary> /// constructor /// </summary> /// <param name="AIdentity"></param> /// <param name="AGroups"></param> /// <param name="AUserTableAccessPermissions"></param> /// <param name="AModuleAccess"></param> public TPetraPrincipal(System.Security.Principal.IIdentity AIdentity, SUserGroupTable AGroups, SUserTableAccessPermissionTable AUserTableAccessPermissions, String[] AModuleAccess) : this(AIdentity, AGroups, AUserTableAccessPermissions, AModuleAccess, null, null) { }
/// <summary> /// constructor /// </summary> /// <param name="AIdentity"></param> /// <param name="AGroups"></param> public TPetraPrincipal(System.Security.Principal.IIdentity AIdentity, SUserGroupTable AGroups) : this(AIdentity, AGroups, null, null, null, null) { }