public interface Acl extends Owner
ACL可以认为是一个带有多个ACL条目数据结构。每个ACL条目,接口类型aclentry,包含一组与特定主体相关的权限。(一个主体表示一个实体,如一个单独的用户或一组)。此外,每个ACL条目被指定为正或负。如果为正,则授予关联主体的权限。如果是否定的,权限将被拒绝。
在每个ACL ACL条目遵守以下规则:
java.security.acl
包提供的接口和相关数据结构的前交叉韧带(ACL条目,组,权限等),和
sun.security.acl
类提供的接口的默认实现。例如,
java.security.acl.Acl
提供接口ACL和
sun.security.acl.AclImpl
类提供的接口的默认实现。
的java.security.acl.Acl
接口扩展java.security.acl.Owner
接口。主界面是用来保持每个ACL的业主名单。只有业主允许修改ACL。例如,只有一个业主可以调用ACL的addEntry
方法添加一个新的ACL ACL条目。
Modifier and Type | Method and Description |
---|---|
boolean |
addEntry(Principal caller, AclEntry entry)
添加一个ACL条目这个韧带。
|
boolean |
checkPermission(Principal principal, Permission permission)
检查指定的主体是否已指定的权限。
|
Enumeration<AclEntry> |
entries()
返回此ACL条目枚举。
|
String |
getName()
返回该ACL的名字。
|
Enumeration<Permission> |
getPermissions(Principal user)
返回指定的主体(表示某个实体,如个人或组)的所允许的权限集的枚举数。
|
boolean |
removeEntry(Principal caller, AclEntry entry)
删除从该ACL ACL条目。
|
void |
setName(Principal caller, String name)
设置此ACL的名字。
|
String |
toString()
返回一个字符串表示的ACL的内容。
|
addOwner, deleteOwner, isOwner
void setName(Principal caller, String name) throws NotOwnerException
caller
-主调用该方法。它必须是该ACL的所有者。
name
的名字给该ACL。
NotOwnerException
如果调用者主体不是该ACL的所有者。
getName()
String getName()
setName(java.security.Principal, java.lang.String)
boolean addEntry(Principal caller, AclEntry entry) throws NotOwnerException
caller
-主调用该方法。它必须是该ACL的所有者。
entry
的ACL条目被添加到该ACL。
NotOwnerException
如果调用者主体不是该ACL的所有者。
boolean removeEntry(Principal caller, AclEntry entry) throws NotOwnerException
caller
-主调用该方法。它必须是该ACL的所有者。
entry
的ACL条目被删除从该ACL。
NotOwnerException
如果调用者主体不是该ACL的所有者。
Enumeration<Permission> getPermissions(Principal user)
个别的正面和负面的权限集也被确定。积极的权限集包含在积极的ACL条目指定的权限(如果有)的主。同样的,消极的权限集包含在负面的ACL条目指定的权限(如果有的话)的主。个体的正(或负)的权限集是空的如果没有一个正(负)在ACL主ACL条目。
授予主体的权限集,然后使用简单的规则计算,即个人权限总是覆盖组权限。这是校长个人的消极的权限设置(权限拒绝重写特定)阳性组的权限集和校长个人的积极的权限集覆盖组负权限集。
user
-主要返回的权限集。
Enumeration<AclEntry> entries()
boolean checkPermission(Principal principal, Permission permission)
getPermissions
方法。
principal
-主,假定是一个有效的验证的主体。
permission
-被检查的许可。
getPermissions(java.security.Principal)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.