@Test void testGetSuitablePermissionsForTypePackage() { assertEquals( newHashSet(READMETA, COUNT, READ, WRITE, WRITEMETA), permissionsApiService.getSuitablePermissionsForType(PACKAGE)); }
@Override public Set<PermissionSet> getSuitablePermissionsForType(String typeId) { entityHelper.checkEntityTypeExists(typeId); Set<PermissionSet> permissions; switch (typeId) { case EntityTypeIdentity.ENTITY_TYPE: case PackageIdentity.PACKAGE: case GroupIdentity.GROUP: permissions = Sets.newHashSet( PermissionSet.READMETA, PermissionSet.COUNT, PermissionSet.READ, PermissionSet.WRITE, PermissionSet.WRITEMETA); break; case PLUGIN: permissions = Sets.newHashSet(PermissionSet.READ); break; default: permissions = Sets.newHashSet(PermissionSet.READ, PermissionSet.WRITE); break; } return permissions; }
PermissionServiceImpl implements PermissionService { @Override public Set<PermissionSet> getSuitablePermissionsForType(String typeId) { entityHelper.checkEntityTypeExists(typeId); Set<PermissionSet> permissions; switch (typeId) { case EntityTypeIdentity.ENTITY_TYPE: case PackageIdentity.PACKAGE: case GroupIdentity.GROUP: permissions = Sets.newHashSet( PermissionSet.READMETA, PermissionSet.COUNT, PermissionSet.READ, PermissionSet.WRITE, PermissionSet.WRITEMETA); break; case PLUGIN: permissions = Sets.newHashSet(PermissionSet.READ); break; default: permissions = Sets.newHashSet(PermissionSet.READ, PermissionSet.WRITE); break; } return permissions; } }
PermissionServiceImpl implements PermissionService { @Override public Set<PermissionSet> getSuitablePermissionsForType(String typeId) { entityHelper.checkEntityTypeExists(typeId); Set<PermissionSet> permissions; switch (typeId) { case EntityTypeIdentity.ENTITY_TYPE: case PackageIdentity.PACKAGE: case GroupIdentity.GROUP: permissions = Sets.newHashSet( PermissionSet.READMETA, PermissionSet.COUNT, PermissionSet.READ, PermissionSet.WRITE, PermissionSet.WRITEMETA); break; case PLUGIN: permissions = Sets.newHashSet(PermissionSet.READ); break; default: permissions = Sets.newHashSet(PermissionSet.READ, PermissionSet.WRITE); break; } return permissions; } PermissionServiceImpl(
      MutableAclService mutableAclService,
      PermissionInheritanceResolver inheritanceResolver,
      ObjectIdentityService objectIdentityService,
      DataService dataService,
      MutableAclClassService mutableAclClassService,
      UserRoleTools userRoleTools,
      EntityHelper entityHelper,
      UserPermissionEvaluator userPermissionEvaluator); }
PermissionServiceImpl implements PermissionService { @Override public Set<PermissionSet> getSuitablePermissionsForType(String typeId) { entityHelper.checkEntityTypeExists(typeId); Set<PermissionSet> permissions; switch (typeId) { case EntityTypeIdentity.ENTITY_TYPE: case PackageIdentity.PACKAGE: case GroupIdentity.GROUP: permissions = Sets.newHashSet( PermissionSet.READMETA, PermissionSet.COUNT, PermissionSet.READ, PermissionSet.WRITE, PermissionSet.WRITEMETA); break; case PLUGIN: permissions = Sets.newHashSet(PermissionSet.READ); break; default: permissions = Sets.newHashSet(PermissionSet.READ, PermissionSet.WRITE); break; } return permissions; } PermissionServiceImpl(
      MutableAclService mutableAclService,
      PermissionInheritanceResolver inheritanceResolver,
      ObjectIdentityService objectIdentityService,
      DataService dataService,
      MutableAclClassService mutableAclClassService,
      UserRoleTools userRoleTools,
      EntityHelper entityHelper,
      UserPermissionEvaluator userPermissionEvaluator); @Override Set<LabelledType> getLabelledTypes(); @Override Set<LabelledObject> getObjects(String typeId, int page, int pageSize); @Override Set<PermissionSet> getSuitablePermissionsForType(String typeId); @Override Set<LabelledPermission> getPermissionsForObject(
      ObjectIdentity objectIdentity, Set<Sid> sids, boolean isReturnInheritedPermissions); @Override Set<LabelledPermission> getPermissions(Set<Sid> sids, boolean isReturnInherited); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, int page, int pageSize); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, boolean isReturnInherited); @Override @Transactional void createAcl(ObjectIdentity objectIdentity); @Override @Transactional void createPermission(Permission permission); @Override @Transactional void createPermissions(Set<Permission> permissions); @Override @Transactional void updatePermission(Permission permission); @Override @Transactional void updatePermissions(Set<Permission> permissions); @Override @Transactional void deletePermission(Sid sid, ObjectIdentity objectIdentity); @Override @Transactional void addType(String typeId); @Override @Transactional void deleteType(String typeId); @Override boolean exists(ObjectIdentity objectIdentity, Sid sid); }
PermissionServiceImpl implements PermissionService { @Override public Set<PermissionSet> getSuitablePermissionsForType(String typeId) { entityHelper.checkEntityTypeExists(typeId); Set<PermissionSet> permissions; switch (typeId) { case EntityTypeIdentity.ENTITY_TYPE: case PackageIdentity.PACKAGE: case GroupIdentity.GROUP: permissions = Sets.newHashSet( PermissionSet.READMETA, PermissionSet.COUNT, PermissionSet.READ, PermissionSet.WRITE, PermissionSet.WRITEMETA); break; case PLUGIN: permissions = Sets.newHashSet(PermissionSet.READ); break; default: permissions = Sets.newHashSet(PermissionSet.READ, PermissionSet.WRITE); break; } return permissions; } PermissionServiceImpl(
      MutableAclService mutableAclService,
      PermissionInheritanceResolver inheritanceResolver,
      ObjectIdentityService objectIdentityService,
      DataService dataService,
      MutableAclClassService mutableAclClassService,
      UserRoleTools userRoleTools,
      EntityHelper entityHelper,
      UserPermissionEvaluator userPermissionEvaluator); @Override Set<LabelledType> getLabelledTypes(); @Override Set<LabelledObject> getObjects(String typeId, int page, int pageSize); @Override Set<PermissionSet> getSuitablePermissionsForType(String typeId); @Override Set<LabelledPermission> getPermissionsForObject(
      ObjectIdentity objectIdentity, Set<Sid> sids, boolean isReturnInheritedPermissions); @Override Set<LabelledPermission> getPermissions(Set<Sid> sids, boolean isReturnInherited); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, int page, int pageSize); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, boolean isReturnInherited); @Override @Transactional void createAcl(ObjectIdentity objectIdentity); @Override @Transactional void createPermission(Permission permission); @Override @Transactional void createPermissions(Set<Permission> permissions); @Override @Transactional void updatePermission(Permission permission); @Override @Transactional void updatePermissions(Set<Permission> permissions); @Override @Transactional void deletePermission(Sid sid, ObjectIdentity objectIdentity); @Override @Transactional void addType(String typeId); @Override @Transactional void deleteType(String typeId); @Override boolean exists(ObjectIdentity objectIdentity, Sid sid);  }