예제 #1
0
파일: User.cs 프로젝트: yhhno/nfx
 /// <summary>
 /// Authorizes user to specified permission.
 /// Note: this authorization call returns AccessLevel object that may contain a complex data structure.
 /// The final assertion of user's ability to perform a certain action is encapsulated in Permission.Check() method.
 /// Call Permission.AuthorizeAndGuardAction(MemberInfo, ISession) to guard classes and methods from unauthorized access
 /// </summary>
 public AccessLevel this[Permission permission]
 {
     get { return App.SecurityManager.Authorize(this, permission); }
 }
예제 #2
0
 public AccessLevel Authorize(User user, Permission permission)
 {
     return new AccessLevel(user, permission, Rights.None.Root);
 }
예제 #3
0
            public AccessLevel Authorize(User user, Permission permission)
            {
                if (user==null || permission==null) 
                 throw new SecurityException(StringConsts.ARGUMENT_ERROR+GetType().Name+".Authorize(user==null|permission==null)");

                var node = user.Rights.Root.NavigateSection(permission.FullPath);

                return new AccessLevel(user, permission, node);
            }
예제 #4
0
 public AccessLevel(User user, Permission permission, IConfigSectionNode data)
 {
     m_User = user;
     m_Permission = permission;
     m_Data = data;
 }
예제 #5
0
 /// <summary>
 /// Authorizes user to specified permission.
 /// Note: this authorization call returns AccessLevel object that may contain a complex data structure.
 /// The final assertion of user's ability to perform a certain action is encapsulated in Permission.Check() method.
 /// Call Permission.AuthorizeAndGuardAction(MemberInfo, ISession) to guard classes and methods from unauthorized access
 /// </summary>
 public AccessLevel this[Permission permission]
 {
     get { return(App.SecurityManager.Authorize(this, permission)); }
 }
예제 #6
0
 public static AccessLevel DeniedFor(User user, Permission permission)
 {
     return new AccessLevel(user, permission, DENIED_CONF);
 }
예제 #7
0
 public AccessLevel Authorize(User user, Permission permission)
 {
     return(new AccessLevel(user, permission, Rights.None.Root));
 }