use of com.ctrip.framework.apollo.common.entity.BaseEntity in project apollo by ctripcorp.
the class DefaultRoleInitializationService method createAppMasterRole.
private void createAppMasterRole(String appId, String operator) {
Set<Permission> appPermissions = Stream.of(PermissionType.CREATE_CLUSTER, PermissionType.CREATE_NAMESPACE, PermissionType.ASSIGN_ROLE).map(permissionType -> createPermission(appId, permissionType, operator)).collect(Collectors.toSet());
Set<Permission> createdAppPermissions = rolePermissionService.createPermissions(appPermissions);
Set<Long> appPermissionIds = createdAppPermissions.stream().map(BaseEntity::getId).collect(Collectors.toSet());
// create app master role
Role appMasterRole = createRole(RoleUtils.buildAppMasterRoleName(appId), operator);
rolePermissionService.createRoleWithPermissions(appMasterRole, appPermissionIds);
}
Aggregations