mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 13:32:24 +00:00
Moved Sid constants to the contract class.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6161 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
e8a9854e23
commit
481bc295f6
1 file changed
+24
@@ -2,6 +2,8 @@ package hudson.security;
|
||||
|
||||
import org.acegisecurity.AccessDeniedException;
|
||||
import org.acegisecurity.Authentication;
|
||||
import org.acegisecurity.acls.sid.PrincipalSid;
|
||||
import org.acegisecurity.acls.sid.Sid;
|
||||
import org.acegisecurity.context.SecurityContextHolder;
|
||||
|
||||
/**
|
||||
@@ -30,4 +32,26 @@ public abstract class ACL {
|
||||
* Checks if the given principle has the given permission.
|
||||
*/
|
||||
public abstract boolean hasPermission(Authentication a, Permission permission);
|
||||
|
||||
//
|
||||
// Sid constants
|
||||
//
|
||||
|
||||
/**
|
||||
* Special {@link Sid} that represents "everyone", even including anonymous users.
|
||||
*
|
||||
* <p>
|
||||
* This doesn't need to be included in {@link Authentication#getAuthorities()},
|
||||
* but {@link ACL} is responsible for checking it nontheless, as if it was the
|
||||
* last entry in the granted authority.
|
||||
*/
|
||||
public static final Sid EVERYONE = new Sid() {};
|
||||
|
||||
/**
|
||||
* {@link Sid} that represents the anonymous unauthenticated users.
|
||||
* <p>
|
||||
* {@link HudsonFilter} sets this up, so this sid remains the same
|
||||
* regardless of the current {@link SecurityRealm} in use.
|
||||
*/
|
||||
public static final Sid ANONYMOUS = new PrincipalSid("anonymous");
|
||||
}
|
||||
Reference in new issue
Block a user