Ejemplo n.º 1
0
 public UserSession(iSystem system, User user, string fromIPAddress)
 {
     this.System        = system;
     this.User          = user;
     this.FromIPAddress = fromIPAddress;
     this.SessionPeriod = new TimeInterval(DateTime.Now);
 }
Ejemplo n.º 2
0
        public virtual List <UserRole> GetEffectiveRoles(iSystem application)
        {
            List <UserRole> roles = new List <UserRole>();

            foreach (UserRole ur in UserRoles)
            {
                if (ur.EffectivePeriod.IsEffectiveOn(DateTime.Now) &&
                    ur.Role.SystemID == application.SystemID)
                {
                    roles.Add(ur);
                }
            }
            return(roles);
        }
Ejemplo n.º 3
0
        public virtual RoleMenu GetEffectiveMenuPermission(iSystem system, int menuID)
        {
            RoleMenu effectiveRoleMenu = null;

            foreach (UserRole ur in this.GetEffectiveRoles(system))
            {
                foreach (RoleMenu rm in ur.Role.Menus)
                {
                    if (rm.Menu.Id == menuID)
                    {
                        rm.MergeMenuPermissionsTo(ref effectiveRoleMenu);
                    }
                }
            }
            return(effectiveRoleMenu);
        }
Ejemplo n.º 4
0
        public virtual int GetEffectivePrivilegeLevel(iSystem system)
        {
            int effectivePrivilegeLevel = 0;

            foreach (UserRole ur in this.GetEffectiveRoles(system))
            {
                if (ur.EffectivePeriod.IsEffectiveOn(DateTime.Now) &&
                    ur.Role.SystemID == system.SystemID)
                {
                    if (effectivePrivilegeLevel < ur.Role.PrivilegeLevel)
                    {
                        effectivePrivilegeLevel = ur.Role.PrivilegeLevel;
                    }
                }
            }
            return(effectivePrivilegeLevel);
        }
Ejemplo n.º 5
0
 public Context(iSystem system, string fromIPAddress)
 {
     this.MySystem      = system;
     this.FromIPAddress = fromIPAddress;
 }
Ejemplo n.º 6
0
        //public Context()
        //{
        //}

        public Context(iSystem system, ISessionFactory sessionFactory)
        {
            this.MySystem           = system;
            this.PersistenceSession = sessionFactory.OpenSession();
        }