Tabnine Logo
Authority.getAuthority
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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 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 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

entry.setAccessStatus(ace.isAllowed() ? AccessStatus.ALLOWED : AccessStatus.DENIED);
entry.setAceType(ace.getAceType());
entry.setAuthority(authority.getAuthority());
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 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));
}
 
org.alfresco.repo.domain.permissionsAuthoritygetAuthority

Popular methods of Authority

  • getId

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now