Example #1
0
File: User.cs Project: 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); }
 }
Example #2
0
 public AccessLevel Authorize(User user, Permission permission)
 {
     return new AccessLevel(user, permission, Rights.None.Root);
 }
Example #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);
            }
Example #4
0
 public AccessLevel(User user, Permission permission, IConfigSectionNode data)
 {
     m_User = user;
     m_Permission = permission;
     m_Data = data;
 }
Example #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)); }
 }
Example #6
0
 public static AccessLevel DeniedFor(User user, Permission permission)
 {
     return new AccessLevel(user, permission, DENIED_CONF);
 }
Example #7
0
 public AccessLevel Authorize(User user, Permission permission)
 {
     return(new AccessLevel(user, permission, Rights.None.Root));
 }