本文整理汇总了Java中javax.annotation.security.RolesAllowed类的典型用法代码示例。如果您正苦于以下问题:Java RolesAllowed类的具体用法?Java RolesAllowed怎么用?Java RolesAllowed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RolesAllowed类属于javax.annotation.security包,在下文中一共展示了RolesAllowed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Transactional
@RolesAllowed("CREATE_OIDC_PROVIDER")
public HttpResponse create(OidcProviderForm form) {
if (form.hasErrors()) {
return templateEngine.render("admin/oidcProvider/new",
"oidcProvider", form,
"responseTypes", ResponseType.values(),
"tokenEndpointAuthMethods", TokenEndpointAuthMethod.values());
} else {
OidcProviderDao oidcProviderDao = daoProvider.getDao(OidcProviderDao.class);
OidcProvider oidcProvider = beansConverter.createFrom(form, OidcProvider.class);
oidcProviderDao.insert(oidcProvider);
return UrlRewriter.redirect(OidcProviderController.class, "list", SEE_OTHER);
}
}
示例2: verifyInjectedIssuer
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@GET
@Path("/verifyInjectedIssuer")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("Tester")
public JsonObject verifyInjectedIssuer(@QueryParam("iss") String iss) {
boolean pass = false;
String msg;
String issValue = issuer.getString();
if(issValue == null || issValue.length() == 0) {
msg = Claims.iss.name()+"value is null or empty, FAIL";
}
else if(issValue.equals(iss)) {
msg = Claims.iss.name()+" PASS";
pass = true;
}
else {
msg = String.format("%s: %s != %s", Claims.iss.name(), issValue, iss);
}
JsonObject result = Json.createObjectBuilder()
.add("pass", pass)
.add("msg", msg)
.build();
return result;
}
示例3: getServiceRolesForService
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "ORGANIZATION_ADMIN", "SUBSCRIPTION_MANAGER" })
public List<VORoleDefinition> getServiceRolesForService(VOService service)
throws ObjectNotFoundException, OperationNotPermittedException {
ArgumentValidator.notNull("service", service);
Product prod = dataManager.getReference(Product.class,
service.getKey());
LocalizerFacade facade = new LocalizerFacade(localizer,
dataManager.getCurrentUser().getLocale());
List<RoleDefinition> roleDefinitions = prod.getTechnicalProduct()
.getRoleDefinitions();
return RoleAssembler.toVORoleDefinitions(roleDefinitions, facade);
}
示例4: getPartnerRevenueSharesForMarketplace
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "SERVICE_MANAGER", "BROKER_MANAGER", "RESELLER_MANAGER",
"MARKETPLACE_OWNER", "PLATFORM_OPERATOR" })
public Response getPartnerRevenueSharesForMarketplace(String marketplaceId)
throws ObjectNotFoundException {
Response response = new Response();
try {
ArgumentValidator.notEmptyString("marketplaceId", marketplaceId);
Marketplace marketplace = mpServiceLocal
.getMarketplace(marketplaceId);
response.getResults().add(toPOPartnerPriceModel(marketplace));
} finally {
}
return response;
}
示例5: verifyInjectedAudience
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@GET
@Path("/verifyInjectedAudience")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("Tester")
public JsonObject verifyInjectedAudience(@QueryParam("aud") String audience) {
boolean pass = false;
String msg;
// aud
List<JsonString> audValue = aud.getValuesAs(JsonString.class);
if(audValue == null || audValue.size() == 0) {
msg = Claims.aud.name()+"value is null or empty, FAIL";
}
else if(audValue.get(0).getString().equals(audience)) {
msg = Claims.aud.name()+" PASS";
pass = true;
}
else {
msg = String.format("%s: %s != %s", Claims.aud.name(), audValue, audience);
}
JsonObject result = Json.createObjectBuilder()
.add("pass", pass)
.add("msg", msg)
.build();
return result;
}
示例6: getServicesForVendor
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@RolesAllowed({ "BROKER_MANAGER", "RESELLER_MANAGER" })
public Response getServicesForVendor() {
Response response = new Response();
List<Product> productList = spPartnerServiceLocal
.getProductsForVendor();
LocalizerFacade facade = new LocalizerFacade(localizer, dm
.getCurrentUser().getLocale());
List<VOService> voServicesList = new ArrayList<VOService>();
for (Product product : productList) {
voServicesList.add(ProductAssembler.toVOProduct(product, facade));
}
response.getResults().add(voServicesList);
return response;
}
示例7: verifyInjectedCustomString
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@GET
@Path("/verifyInjectedCustomString")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("Tester")
public JsonObject verifyInjectedCustomString(@QueryParam("value") String value) {
boolean pass = false;
String msg;
// iat
String customValue = customString.getString();
if(customValue == null || customValue.length() == 0) {
msg = "customString value is null or empty, FAIL";
}
else if(customValue.equals(value)) {
msg = "customString PASS";
pass = true;
}
else {
msg = String.format("customString: %s != %s", customValue, value);
}
JsonObject result = Json.createObjectBuilder()
.add("pass", pass)
.add("msg", msg)
.build();
return result;
}
示例8: edit
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@RolesAllowed({"MODIFY_GROUP", "MODIFY_ANY_GROUP"})
public HttpResponse edit(Parameters params) {
GroupDao groupDao = daoProvider.getDao(GroupDao.class);
Group group = groupDao.selectById(params.getLong("id"));
GroupForm form = beansConverter.createFrom(group, GroupForm.class);
UserDao userDao = daoProvider.getDao(UserDao.class);
List<User> users = userDao.selectAll();
List<Long> userIds = userDao.selectByGroupId(group.getId())
.stream()
.map(User::getId)
.collect(Collectors.toList());
return templateEngine.render("admin/group/edit",
"group", form,
"users", users,
"userIds", userIds);
}
示例9: getTriggerTypes
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "ORGANIZATION_ADMIN", "PLATFORM_OPERATOR" })
public List<TriggerType> getTriggerTypes() {
Organization org = this.getOwnOrganization();
Set<OrganizationRoleType> orgRoles = org.getGrantedRoleTypes();
Set<TriggerType> triggerTypesSet = new HashSet<TriggerType>();
if (orgRoles != null) {
for (OrganizationRoleType orgRole : orgRoles) {
triggerTypesSet.addAll(getTriggerTypesForRole(orgRole));
}
}
List<TriggerType> triggerTypesList = new ArrayList<TriggerType>();
triggerTypesList.addAll(triggerTypesSet);
return triggerTypesList;
}
示例10: getPartnerServicesWithRevenueShareForTemplate
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed("PLATFORM_OPERATOR")
public Response getPartnerServicesWithRevenueShareForTemplate(
POServiceForPricing service) throws ObjectNotFoundException,
ServiceOperationException {
ArgumentValidator.notNull("service", service);
List<POServicePricing> pricings = new ArrayList<POServicePricing>();
List<Product> partnerProducts = spPartnerServiceLocal
.getPartnerProductsForTemplate(service.getKey());
for (Product partnerProduct : partnerProducts) {
pricings.add(assembleServicePricing(partnerProduct));
}
return new Response(pricings);
}
示例11: getPartnerRevenueShareForAllStatesService
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "SERVICE_MANAGER", "BROKER_MANAGER", "RESELLER_MANAGER",
"MARKETPLACE_OWNER", "PLATFORM_OPERATOR" })
public Response getPartnerRevenueShareForAllStatesService(
POServiceForPricing service) throws ObjectNotFoundException,
OperationNotPermittedException, ServiceOperationException,
ServiceStateException {
ArgumentValidator.notNull("service", service);
Map<RevenueShareModelType, RevenueShareModel> revenueShareModels = spPartnerServiceLocal
.getRevenueShareModelsForProduct(service.getKey(),
STATUS_CHECK_NOT_NEEDED);
Response response = getRevenueShareModels(revenueShareModels);
return response;
}
示例12: exportBillingData
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "SERVICE_MANAGER", "RESELLER_MANAGER" })
public Response exportBillingData(POBillingDataExport exportParam)
throws NoBilingSharesDataAvailableException,
OrganizationAuthoritiesException {
ArgumentValidator.notNull("exportParam", exportParam);
ArgumentValidator.notNull("from", exportParam.getFrom());
ArgumentValidator.notNull("to", exportParam.getTo());
Long from = DateConverter
.getBeginningOfDayInCurrentTimeZone(exportParam.getFrom());
Long to = DateConverter
.getBeginningOfNextDayInCurrentTimeZone(exportParam.getTo());
byte[] xmlResult = null;
xmlResult = billingService.getCustomerBillingData(from, to,
exportParam.getOrganizationIds());
if (xmlResult == null || xmlResult.length < 1) {
throw new NoBilingSharesDataAvailableException();
}
return new Response(xmlResult);
}
示例13: getUnassignedUsersByOrg
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "ORGANIZATION_ADMIN", "SUBSCRIPTION_MANAGER",
"UNIT_ADMINISTRATOR" })
public List<VOUserDetails> getUnassignedUsersByOrg(Long subscriptionKey,
Long organizationKey) {
Query query = dm.createNativeQuery(
"select distinct usr.tkey, usr.userid, usr.firstname, usr.lastname from PlatformUser as usr "
+ " where not exists (select 1 from UsageLicense as lic1 where lic1.subscription_tkey=:subscriptionKey and lic1.user_tkey=usr.tkey) and usr.organizationkey=:organizationKey");
query.setParameter("subscriptionKey", subscriptionKey);
query.setParameter("organizationKey", organizationKey);
List<VOUserDetails> result = new ArrayList<>();
List<Object[]> resultList = query.getResultList();
VOUserDetails pu;
for (Object[] cols : resultList) {
pu = new VOUserDetails();
pu.setKey(((BigInteger) cols[TKEY_INDEX]).longValue());
pu.setUserId((String) cols[ID_INDEX]);
pu.setFirstName((String) cols[FIRST_NAME_INDEX]);
pu.setLastName((String) cols[LAST_NAME_INDEX]);
result.add(pu);
}
return result;
}
示例14: getSuppliedServices
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@RolesAllowed({ "SERVICE_MANAGER", "RESELLER_MANAGER", "BROKER_MANAGER" })
public List<VOService> getSuppliedServices(
PerformanceHint performanceHint) {
Organization currentUsersOrg = dm.getCurrentUser().getOrganization();
EnumSet<ServiceType> serviceTypes = getServiceTypesForOrg(
currentUsersOrg);
List<Product> productList = getProductsOfSupplier(currentUsersOrg,
serviceTypes);
LocalizerFacade facade = new LocalizerFacade(localizer,
dm.getCurrentUser().getLocale());
ProductAssembler.prefetchData(productList, facade, performanceHint);
List<VOService> voList = new ArrayList<>();
for (Product product : productList) {
voList.add(ProductAssembler.toVOProduct(product, facade,
performanceHint));
}
return voList;
}
示例15: activateService
import javax.annotation.security.RolesAllowed; //导入依赖的package包/类
@Override
@RolesAllowed({ "SERVICE_MANAGER", "RESELLER_MANAGER", "BROKER_MANAGER" })
public VOService activateService(VOService service)
throws ServiceStateException, ObjectNotFoundException,
OrganizationAuthoritiesException, OperationNotPermittedException,
ServiceOperationException, TechnicalServiceNotAliveException,
ServiceNotPublishedException, OperationPendingException,
ConcurrentModificationException {
// Activate service
ServiceVisibilityCheck visChecker = new ServiceVisibilityCheck(dm);
VOService voProduct = setActivationState(service, true, null,
visChecker);
// Check constraint about visibility
try {
visChecker.validate();
} catch (ServiceOperationException e) {
sessionCtx.setRollbackOnly();
throw e;
}
return voProduct;
}