Exemplo n.º 1
0
        public questStatus Read(DbMgrTransaction trans, UserId userId, out UserPrivilegeList userPrivilegeList)
        {
            // Initialize
            questStatus status = null;

            userPrivilegeList = null;


            // Read userPrivilege
            status = _dbUserPrivilegesMgr.Read(trans, userId, out userPrivilegeList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 2
0
        public questStatus Read(UserId userId, out UserPrivilegeList userPrivilegeList)
        {
            // Initialize
            questStatus status = null;

            userPrivilegeList = null;


            // Get user
            User user = null;

            status = _dbUsersMgr.Read(userId, out user);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Get user privileges
            using (FMSEntities dbContext = new FMSEntities())
            {
                List <Quest.Services.Dbio.FMS.UserPrivileges> _userPrivilegeList = null;
                status = read(dbContext, userId, out _userPrivilegeList);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                userPrivilegeList      = new UserPrivilegeList();
                userPrivilegeList.User = user;
                foreach (Quest.Services.Dbio.FMS.UserPrivileges _userPrivilege in _userPrivilegeList)
                {
                    // Get privilege
                    PrivilegeId privilegeId = new PrivilegeId(_userPrivilege.PrivilegeId);
                    Privilege   privilege   = null;
                    status = _dbPrivilegesMgr.Read(privilegeId, out privilege);
                    if (!questStatusDef.IsSuccess(status))
                    {
                        return(status);
                    }
                    userPrivilegeList.PrivilegeList.Add(privilege);
                }
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 3
0
        public questStatus GetUserPrivileges(UserId userId, out List <Privilege> privilegeList)
        {
            // Initialize
            questStatus status = null;

            privilegeList = null;


            // Get all user privileges.
            UserPrivilegeList userPrivilegeList = null;

            status = _dbUserPrivilegesMgr.Read(userId, out userPrivilegeList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Return privileges
            privilegeList = userPrivilegeList.PrivilegeList;

            return(new questStatus(Severity.Success));
        }