Codota Logo
Authority
Code IndexAdd Codota to your IDE (free)

How to use
Authority
in
org.alfresco.repo.domain.permissions

Best Java code snippets using org.alfresco.repo.domain.permissions.Authority (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 public final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
boolean flag = false;

for (Authority authority: authentication.getAuthorities()) {
  if (authority.getAuthority().equals(role)) flag = true;
}
origin: Alfresco/alfresco-repository

public void testCreateUpdateAndDeleteAuth() throws Exception
{
  final String authName = getName() + "-" + System.currentTimeMillis();
  
  Authority authEntity= getAuth(authName);
  assertNull(authEntity);
  
  Authority createAuthEntity = createAuth(authName);
  assertNotNull(createAuthEntity);
  
  authEntity= getAuth(authName);
  assertEquals(createAuthEntity, authEntity);
  
  String newAuthName = authName+"-new";
  updateAuth(authName, newAuthName);
  
  assertNull(getAuth(authName));
  
  authEntity = getAuth(newAuthName);
  assertNotNull(authEntity);
  assertEquals(createAuthEntity.getId(), authEntity.getId());
  assertEquals(newAuthName, authEntity.getAuthority());
  
  deleteAuth(authEntity.getId());
  
  assertNull(getAuth(newAuthName));
}
 
origin: Alfresco/alfresco-repository

public Ace getAce(Permission permission, Authority authority, ACEType type, AccessStatus accessStatus)
{
  ParameterCheck.mandatory("permission", permission);
  ParameterCheck.mandatory("authority", authority);
  ParameterCheck.mandatory("type", type);
  ParameterCheck.mandatory("accessStatus", accessStatus);
  
  return getAceEntity(permission.getId(),
            authority.getId(),
            ((accessStatus == AccessStatus.ALLOWED) ? true : false), 
            type);
}
 
origin: org.alfresco/alfresco-repository

public Ace getAce(Permission permission, Authority authority, ACEType type, AccessStatus accessStatus)
{
  ParameterCheck.mandatory("permission", permission);
  ParameterCheck.mandatory("authority", authority);
  ParameterCheck.mandatory("type", type);
  ParameterCheck.mandatory("accessStatus", accessStatus);
  
  return getAceEntity(permission.getId(),
            authority.getId(),
            ((accessStatus == AccessStatus.ALLOWED) ? true : false), 
            type);
}
 
origin: stackoverflow.com

 public class CurrentUser extends User implements UserDetails {

  private final Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>();

  public CurrentUser(User user) {
    super(user);
    initAuthorities(user);
  }

  private void initAuthorities(User user) {
    if (user.getRoles() == null) {
      return;
    }
    for (Authority role : user.getRoles()) {
      authorities.add(new SimpleGrantedAuthority(role.getAuthority()));
    }
  }

  @Override
  public Collection<GrantedAuthority> getAuthorities() {
    return authorities;
  }

  // implement the rest of UserDetails interface accordingly
}
origin: org.alfresco/alfresco-repository

@Override
protected int updateAuthorityEntity(AuthorityEntity authorityEntity)
{
  Authority existingAuthorityEntity = getAuthority(authorityEntity.getAuthority());
  if(existingAuthorityEntity != null)
  {
    for(Ace ace : getAceEntitiesByAuthority(existingAuthorityEntity.getId()))
    {
      AceEntity aceEntity = getAceEntity(ace.getId());
      aceEntity.setAuthorityId(authorityEntity.getId());
      updateAceEntity(aceEntity);
    }
    deleteAuthority(existingAuthorityEntity.getId());
  }
  
  authorityEntity.incrementVersion();
  
  return template.update(UPDATE_AUTHORITY, authorityEntity);
}
 
origin: Alfresco/alfresco-repository

@Override
protected int updateAceEntity(AceEntity updatedAceEntity)
{   
  AceEntity existingAceEntity = getAceEntity(updatedAceEntity.getPermissionId(), updatedAceEntity.getAuthorityId(), updatedAceEntity.isAllowed(), updatedAceEntity.getAceType());
  if(existingAceEntity != null)
  {
    for(AclMemberEntity aclMemberEntity : getAclMemberEntitiesByAuthority(getAuthority(updatedAceEntity.getAuthorityId()).getAuthority()))
    {
      aclMemberEntity.setAceId(updatedAceEntity.getId());
      updateAclMember(aclMemberEntity);
    }
    deleteAceEntities(Collections.singletonList(existingAceEntity.getId()));
  }
  
  updatedAceEntity.incrementVersion();
  
  return template.update(UPDATE_ACE, updatedAceEntity);
}
 
origin: Alfresco/alfresco-repository

@Override
protected int updateAuthorityEntity(AuthorityEntity authorityEntity)
{
  Authority existingAuthorityEntity = getAuthority(authorityEntity.getAuthority());
  if(existingAuthorityEntity != null)
  {
    for(Ace ace : getAceEntitiesByAuthority(existingAuthorityEntity.getId()))
    {
      AceEntity aceEntity = getAceEntity(ace.getId());
      aceEntity.setAuthorityId(authorityEntity.getId());
      updateAceEntity(aceEntity);
    }
    deleteAuthority(existingAuthorityEntity.getId());
  }
  
  authorityEntity.incrementVersion();
  
  return template.update(UPDATE_AUTHORITY, authorityEntity);
}
 
origin: org.alfresco/alfresco-repository

@Override
protected int updateAceEntity(AceEntity updatedAceEntity)
{   
  AceEntity existingAceEntity = getAceEntity(updatedAceEntity.getPermissionId(), updatedAceEntity.getAuthorityId(), updatedAceEntity.isAllowed(), updatedAceEntity.getAceType());
  if(existingAceEntity != null)
  {
    for(AclMemberEntity aclMemberEntity : getAclMemberEntitiesByAuthority(getAuthority(updatedAceEntity.getAuthorityId()).getAuthority()))
    {
      aclMemberEntity.setAceId(updatedAceEntity.getId());
      updateAclMember(aclMemberEntity);
    }
    deleteAceEntities(Collections.singletonList(existingAceEntity.getId()));
  }
  
  updatedAceEntity.incrementVersion();
  
  return template.update(UPDATE_ACE, updatedAceEntity);
}
 
origin: org.alfresco/alfresco-repository

List<Ace> unreferenced = aclCrudDAO.getAcesByAuthority(authEntity.getId());
  aclCrudDAO.deleteAuthority(authEntity.getId());
origin: org.alfresco/alfresco-repository

entry.setAccessStatus(ace.isAllowed() ? AccessStatus.ALLOWED : AccessStatus.DENIED);
entry.setAceType(ace.getAceType());
entry.setAuthority(authority.getAuthority());
origin: Alfresco/alfresco-repository

List<Ace> unreferenced = aclCrudDAO.getAcesByAuthority(authEntity.getId());
  aclCrudDAO.deleteAuthority(authEntity.getId());
origin: Alfresco/alfresco-repository

entry.setAccessStatus(ace.isAllowed() ? AccessStatus.ALLOWED : AccessStatus.DENIED);
entry.setAceType(ace.getAceType());
entry.setAuthority(authority.getAuthority());
origin: Alfresco/alfresco-repository

public Ace createAce(Permission permission, Authority authority, ACEType type, AccessStatus accessStatus)
{
  ParameterCheck.mandatory("permission", permission);
  ParameterCheck.mandatory("authority", authority);
  ParameterCheck.mandatory("type", type);
  ParameterCheck.mandatory("accessStatus", accessStatus);
  
  AceEntity entity = new AceEntity();
  
  entity.setApplies(type.getId()); // note: 'applies' stores the ACE type
  entity.setAllowed((accessStatus == AccessStatus.ALLOWED) ? true : false);
  entity.setAuthorityId(authority.getId());
  entity.setPermissionId(permission.getId());
  
  long aceId = createAceEntity(entity);
  
  entity.setVersion(0L);
  entity.setId(aceId);
  
  return entity;
}
 
origin: org.alfresco/alfresco-repository

public Ace createAce(Permission permission, Authority authority, ACEType type, AccessStatus accessStatus)
{
  ParameterCheck.mandatory("permission", permission);
  ParameterCheck.mandatory("authority", authority);
  ParameterCheck.mandatory("type", type);
  ParameterCheck.mandatory("accessStatus", accessStatus);
  
  AceEntity entity = new AceEntity();
  
  entity.setApplies(type.getId()); // note: 'applies' stores the ACE type
  entity.setAllowed((accessStatus == AccessStatus.ALLOWED) ? true : false);
  entity.setAuthorityId(authority.getId());
  entity.setPermissionId(permission.getId());
  
  long aceId = createAceEntity(entity);
  
  entity.setVersion(0L);
  entity.setId(aceId);
  
  return entity;
}
 
org.alfresco.repo.domain.permissionsAuthority

Javadoc

Entity for alf_authority persistence.

Most used methods

  • getAuthority
  • getId

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • BoxLayout (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now