本文整理汇总了Java中org.guvnor.structure.security.OrganizationalUnitAction类的典型用法代码示例。如果您正苦于以下问题:Java OrganizationalUnitAction类的具体用法?Java OrganizationalUnitAction怎么用?Java OrganizationalUnitAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrganizationalUnitAction类属于org.guvnor.structure.security包,在下文中一共展示了OrganizationalUnitAction类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultOrganizationalUnit
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
private OrganizationalUnit createDefaultOrganizationalUnit() {
if (!authorizationManager.authorize(OrganizationalUnit.RESOURCE_TYPE,
OrganizationalUnitAction.CREATE,
sessionInfo.getIdentity())) {
return null;
}
final LibraryPreferences preferences = getPreferences();
final List<String> contributors = new ArrayList<>();
contributors.add(preferences.getOrganizationalUnitPreferences().getOwner());
return ouService.createOrganizationalUnit(preferences.getOrganizationalUnitPreferences().getName(),
preferences.getOrganizationalUnitPreferences().getOwner(),
preferences.getOrganizationalUnitPreferences().getGroupId(),
Collections.emptyList(),
contributors);
}
示例2: migrateOrgUnits
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public void migrateOrgUnits(AuthorizationPolicy policy) {
Collection<OrganizationalUnit> itemList = organizationalUnitService.getAllOrganizationalUnits();
for (OrganizationalUnit item : itemList) {
Permission p = permissionManager.createPermission(item,
OrganizationalUnitAction.READ,
true);
for (String groupName : item.getGroups()) {
Group group = getGroup(groupName);
PermissionCollection pc = policy.getPermissions(group);
pc.add(p);
}
}
}
示例3: getMenus
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
@WorkbenchMenu
public Menus getMenus() {
return MenuFactory
.newTopLevelMenu( constants.MenuOrganizationalUnits() )
.withPermission( OrganizationalUnit.RESOURCE_TYPE, OrganizationalUnitAction.READ )
.menus()
.menu( constants.MenuManageOrganizationalUnits() )
.respondsWith( () -> placeManager.goTo( "org.kie.workbench.common.screens.organizationalunit.manager.OrganizationalUnitManager" ) )
.endMenu()
.endMenus()
.endMenu()
.newTopLevelMenu( constants.repositories() )
.menus()
.menu( constants.listRepositories() )
.withPermission( Repository.RESOURCE_TYPE, RepositoryAction.READ )
.respondsWith( () -> placeManager.goTo( "RepositoriesEditor" ) )
.endMenu()
.menu( constants.cloneRepository() )
.withPermission( Repository.RESOURCE_TYPE, RepositoryAction.CREATE )
.respondsWith( cloneRepoCommand )
.endMenu()
.menu( constants.newRepository() )
.withPermission( Repository.RESOURCE_TYPE, RepositoryAction.CREATE )
.respondsWith( newRepoCommand )
.endMenu()
.endMenus()
.endMenu().build();
}
示例4: canCreateOrgUnits
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public boolean canCreateOrgUnits() {
return authorizationManager.authorize(OrganizationalUnit.RESOURCE_TYPE,
OrganizationalUnitAction.CREATE,
user);
}
示例5: canReadOrgUnits
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public boolean canReadOrgUnits() {
return authorizationManager.authorize(OrganizationalUnit.RESOURCE_TYPE,
OrganizationalUnitAction.READ,
user);
}
示例6: canReadOrgUnit
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public boolean canReadOrgUnit(OrganizationalUnit organizationalUnit) {
return authorizationManager.authorize(organizationalUnit,
OrganizationalUnitAction.READ,
user);
}
示例7: canUpdateOrgUnit
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public boolean canUpdateOrgUnit(OrganizationalUnit organizationalUnit) {
return authorizationManager.authorize(organizationalUnit,
OrganizationalUnitAction.UPDATE,
user);
}
示例8: canDeleteOrgUnit
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
public boolean canDeleteOrgUnit(OrganizationalUnit organizationalUnit) {
return authorizationManager.authorize(organizationalUnit,
OrganizationalUnitAction.DELETE,
user);
}
示例9: setOUCreationPermission
import org.guvnor.structure.security.OrganizationalUnitAction; //导入依赖的package包/类
private void setOUCreationPermission(final boolean hasPermission) {
when(authorizationManager.authorize(eq(OrganizationalUnit.RESOURCE_TYPE),
eq(OrganizationalUnitAction.CREATE),
any(User.class))).thenReturn(hasPermission);
}