本文整理汇总了Java中org.springframework.security.acls.domain.AclAuthorizationStrategy类的典型用法代码示例。如果您正苦于以下问题:Java AclAuthorizationStrategy类的具体用法?Java AclAuthorizationStrategy怎么用?Java AclAuthorizationStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AclAuthorizationStrategy类属于org.springframework.security.acls.domain包,在下文中一共展示了AclAuthorizationStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertAce
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@Override
public void insertAce(int atIndexLocation, Permission permission, Sid sid, boolean granting) throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
Assert.notNull(permission, "Permission required");
Assert.notNull(sid, "Sid required");
if (atIndexLocation < 0) {
throw new NotFoundException("atIndexLocation must be greater than or equal to zero");
}
if (atIndexLocation > this.aces.size()) {
throw new NotFoundException("atIndexLocation must be less than or equal to the size of the AccessControlEntry collection");
}
AccessControlEntryImpl ace = new AccessControlEntryImpl.Builder()
.acl(this)
.sid(TenantSid.from(sid))
.permission(permission)
.granting(granting).build();
synchronized (aces) {
this.aces.add(atIndexLocation, ace);
}
}
示例2: MongodbAclService
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public MongodbAclService(AclEntryRepository aclEntryRepository,
AclObjectIdentityRepository objectIdentityRepository,
AclSidRepository sidRepository,
AclClassService aclClassService,
AclCache aclCache,
AclAuthorizationStrategy aclAuthorizationStrategy,
PermissionFactory permissionFactory,
PermissionGrantingStrategy grantingStrategy) {
super();
this.aclEntryRepository = aclEntryRepository;
this.objectIdentityRepository = objectIdentityRepository;
this.sidRepository = sidRepository;
this.aclClassService = aclClassService;
this.aclCache = aclCache;
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
this.permissionFactory = permissionFactory;
this.grantingStrategy = grantingStrategy;
this.fieldAces.setAccessible(true);
this.fieldAcl.setAccessible(true);
}
示例3: initBeans
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Before
public void initBeans() {
AclAuthorizationStrategy authorizationStrategy = new AclAuthorizationStrategyImpl(
new SimpleGrantedAuthority("ROLE_ADMINISTRATOR"),
new SimpleGrantedAuthority("ROLE_ADMINISTRATOR"),
new SimpleGrantedAuthority("ROLE_ADMINISTRATOR")
);
cache = new EhCacheBasedAclCache(getCache());
mongodbMutableAclService = new MongodbMutableAclService(
aclEntryRepository,
objectIdentityRepository,
aclSidRepository,
new SimpleCacheAclClassService(aclClassRepository),
cache,
authorizationStrategy,
new DefaultPermissionFactory(),
new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()));
seedMongodbData();
}
示例4: initBeans
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Before
public void initBeans() {
AclAuthorizationStrategy authorizationStrategy = new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_ADMINISTRATOR"));
EhCacheBasedAclCache cache = new EhCacheBasedAclCache(getCache());
mongodbAclService = new MongodbAclService(
aclEntryRepository,
objectIdentityRepository,
aclSidRepository,
new SimpleCacheAclClassService(aclClassRepository),
cache,
authorizationStrategy,
new DefaultPermissionFactory(),
new DefaultPermissionGrantingStrategy(new ConsoleAuditLogger()));
seedMongodbData();
}
示例5: Neo4jLookupStrategy
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
/**
* Constructor
*
* @param graphDatabaseService - Graph Database Service
* @param aclCache - Acl Cache
* @param aclAuthorizationStrategy - Acl Authorization Strategy
* @param permissionGrantingStrategy - Permission Granting Strategy
*/
public Neo4jLookupStrategy(GraphDatabaseService graphDatabaseService,
AclCache aclCache,
AclAuthorizationStrategy aclAuthorizationStrategy,
PermissionGrantingStrategy permissionGrantingStrategy) {
Assert.notNull(aclCache, "AclCache required");
Assert.notNull(aclAuthorizationStrategy,
"AclAuthorizationStrategy required");
Assert.notNull(permissionGrantingStrategy,
"permissionGrantingStrategy required");
this.aclCache = aclCache;
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
this.permissionGrantingStrategy = permissionGrantingStrategy;
this.neo4jTemplate = new Neo4jTemplate(graphDatabaseService);
fieldAces.setAccessible(true);
fieldAcl.setAccessible(true);
}
示例6: BasicLookupStrategy
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public BasicLookupStrategy(DataSource dataSource, AclCache aclCache,
AclAuthorizationStrategy aclAuthorizationStrategy, PermissionGrantingStrategy grantingStrategy) {
Assert.notNull(dataSource, "DataSource required");
Assert.notNull(aclCache, "AclCache required");
Assert.notNull(aclAuthorizationStrategy, "AclAuthorizationStrategy required");
Assert.notNull(grantingStrategy, "grantingStrategy required");
jdbcTemplate = new JdbcTemplate(dataSource);
this.aclCache = aclCache;
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
this.grantingStrategy = grantingStrategy;
fieldAces.setAccessible(true);
fieldAcl.setAccessible(true);
}
示例7: deleteAce
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@Override
public void deleteAce(int aceIndex) throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
this.aces.remove(aceIndex);
}
}
示例8: updateAce
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@Override
public void updateAce(int aceIndex, Permission permission)
throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
AccessControlEntryImpl ace = (AccessControlEntryImpl) aces.get(aceIndex);
aces.set(aceIndex, new AccessControlEntryImpl.Builder().from(ace).permission(permission).build());
}
}
示例9: updateAuditing
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@Override
public void updateAuditing(int aceIndex, boolean auditSuccess, boolean auditFailure) {
aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_AUDITING);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
AccessControlEntryImpl ace = (AccessControlEntryImpl) aces.get(aceIndex);
aces.set(aceIndex, new AccessControlEntryImpl.Builder().from(ace)
.auditSuccess(auditSuccess)
.auditFailure(auditFailure)
.build());
}
}
示例10: MongoAclService
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public MongoAclService(DB db, AclCache aclCache, PermissionGrantingStrategy permissionGrantingStrategy,
AclAuthorizationStrategy aclAuthorizationStrategy) {
this.db = db;
this.aclCache = aclCache;
this.permissionGrantingStrategy = permissionGrantingStrategy;
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
}
示例11: MongodbMutableAclService
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public MongodbMutableAclService(AclEntryRepository aclEntryRepository,
AclObjectIdentityRepository objectIdentityRepository,
AclSidRepository aclSidRepository,
AclClassService aclClassService,
AclCache aclCache,
AclAuthorizationStrategy aclAuthorizationStrategy,
PermissionFactory permissionFactory,
PermissionGrantingStrategy grantingStrategy) {
super(aclEntryRepository, objectIdentityRepository, aclSidRepository, aclClassService,
aclCache, aclAuthorizationStrategy,
permissionFactory, grantingStrategy);
}
示例12: CassandraAclService
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
/**
* Constructs a new <code>CassandraAclService</code> object.
*
* @param aclRepository the {@link CassandraAclRepository} to use for access to the database.
* @param aclCache the {@link AclCache} to use (can be <code>null</code>).
* @param grantingStrategy the {@link PermissionGrantingStrategy} to use when creating {@link Acl} objects.
* @param aclAuthorizationStrategy the {@link AclAuthorizationStrategy} to use when creating {@link Acl} objects.
* @param permissionFactory the {@link PermissionFactory} to use when creating {@link AccessControlEntry} objects.
*/
public CassandraAclService(CassandraAclRepository aclRepository, AclCache aclCache, PermissionGrantingStrategy grantingStrategy,
AclAuthorizationStrategy aclAuthorizationStrategy, PermissionFactory permissionFactory) {
this.aclRepository = aclRepository;
this.aclCache = aclCache;
this.grantingStrategy = grantingStrategy;
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
this.permissionFactory = permissionFactory;
this.fieldAces.setAccessible(true);
}
示例13: getAclAuthorizationStrategy
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public AclAuthorizationStrategy getAclAuthorizationStrategy() {
return aclAuthorizationStrategy;
}
示例14: setAclAuthorizationStrategy
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
public void setAclAuthorizationStrategy(AclAuthorizationStrategy aclAuthorizationStrategy) {
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
}
示例15: setEntriesInheriting
import org.springframework.security.acls.domain.AclAuthorizationStrategy; //导入依赖的package包/类
@Override
public void setEntriesInheriting(boolean entriesInheriting) {
aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
this.entriesInheriting = entriesInheriting;
}