當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。