当前位置: 首页>>代码示例>>Java>>正文


Java RolesAllowed类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:kawasima,项目名称:bouncr,代码行数:17,代码来源:OidcProviderController.java

示例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;
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:25,代码来源:JsonValuejectionEndpoint.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:SubscriptionServiceBean.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:PricingServiceBean.java

示例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;
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:26,代码来源:JsonValuejectionEndpoint.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:21,代码来源:ResaleServiceBean.java

示例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;
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:26,代码来源:JsonValuejectionEndpoint.java

示例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);
}
 
开发者ID:kawasima,项目名称:bouncr,代码行数:20,代码来源:GroupController.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:TriggerDefinitionServiceBean.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:PricingServiceBean.java

示例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;

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:PricingServiceBean.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:24,代码来源:ExportBillingDataServiceBean.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:25,代码来源:OperatorServiceBean.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:21,代码来源:ServiceProvisioningServiceBean.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:25,代码来源:ServiceProvisioningServiceBean.java


注:本文中的javax.annotation.security.RolesAllowed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。