Examples of permission()


Examples of org.infinispan.configuration.global.GlobalRoleConfigurationBuilder.permission()

   private void parseGlobalRole(XMLExtendedStreamReader reader, GlobalAuthorizationConfigurationBuilder builder) throws XMLStreamException {
      String[] attributes = ParseUtils.requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.PERMISSIONS.getLocalName());
      GlobalRoleConfigurationBuilder role = builder.role(attributes[0]);
      for(String permission : attributes[1].split("\\s+")) {
         role.permission(permission);
      }
      for (int i = 0; i < reader.getAttributeCount(); i++) {
         ParseUtils.requireNoNamespaceAttribute(reader, i);
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalRoleConfigurationBuilder.permission()

      Map<String, AuthorizationPermission[]> rolePermissionMap = getRolePermissionMap();
      for (Entry<String, AuthorizationPermission[]> role : rolePermissionMap.entrySet()) {
         authConfig = authConfig.role(role.getKey());
         GlobalRoleConfigurationBuilder roleBuilder = globalRoles.role(role.getKey());
         for (AuthorizationPermission permission : role.getValue()) {
            roleBuilder = roleBuilder.permission(permission);
         }
      }

      Subject admin = getAdminSubject();
      Security.doAs(admin, new PrivilegedExceptionAction<Void>() {
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalRoleConfigurationBuilder.permission()

   private void parseGlobalRole(XMLExtendedStreamReader reader, GlobalAuthorizationConfigurationBuilder builder) throws XMLStreamException {
      String[] attributes = ParseUtils.requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.PERMISSIONS.getLocalName());
      GlobalRoleConfigurationBuilder role = builder.role(attributes[0]);
      for(String permission : attributes[1].split("\\s+")) {
         role.permission(permission);
      }
      for (int i = 0; i < reader.getAttributeCount(); i++) {
         ParseUtils.requireNoNamespaceAttribute(reader, i);
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalRoleConfigurationBuilder.permission()

   private void parseGlobalRole(XMLExtendedStreamReader reader, GlobalAuthorizationConfigurationBuilder builder) throws XMLStreamException {
      String[] attributes = ParseUtils.requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.PERMISSIONS.getLocalName());
      GlobalRoleConfigurationBuilder role = builder.role(attributes[0]);
      for(String permission : attributes[1].split("\\s+")) {
         role.permission(permission);
      }
      for (int i = 0; i < reader.getAttributeCount(); i++) {
         ParseUtils.requireNoNamespaceAttribute(reader, i);
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalRoleConfigurationBuilder.permission()

      Map<String, AuthorizationPermission[]> rolePermissionMap = getRolePermissionMap();
      for (Entry<String, AuthorizationPermission[]> role : rolePermissionMap.entrySet()) {
         authConfig = authConfig.role(role.getKey());
         GlobalRoleConfigurationBuilder roleBuilder = globalRoles.role(role.getKey());
         for (AuthorizationPermission permission : role.getValue()) {
            roleBuilder = roleBuilder.permission(permission);
         }
      }

      Subject admin = getAdminSubject();
      Subject.doAs(admin, new PrivilegedExceptionAction<Void>() {
View Full Code Here

Examples of org.red5.annotations.DeclareProtected.permission()

        log.debug("Method {} is declared private.", method);
        throw new NotAllowedException("Access denied, method is private");
      }
      final DeclareProtected annotation = method.getAnnotation(DeclareProtected.class);
      if (annotation != null) {
        if (!conn.getClient().hasPermission(conn, annotation.permission())) {
          // client doesn't have required permission
          log.debug("Client {} doesn't have required permission {} to call {}", new Object[] { conn.getClient(), annotation.permission(), method });
          throw new NotAllowedException("Access denied, method is protected");
        }
      }
View Full Code Here

Examples of org.red5.annotations.DeclareProtected.permission()

      }
      final DeclareProtected annotation = method.getAnnotation(DeclareProtected.class);
      if (annotation != null) {
        if (!conn.getClient().hasPermission(conn, annotation.permission())) {
          // client doesn't have required permission
          log.debug("Client {} doesn't have required permission {} to call {}", new Object[] { conn.getClient(), annotation.permission(), method });
          throw new NotAllowedException("Access denied, method is protected");
        }
      }
      log.debug("Invoking method: {}", method.toString());
      if (method.getReturnType().equals(Void.TYPE)) {
View Full Code Here

Examples of org.red5.annotations.DeclareProtected.permission()

        throw new NotAllowedException("you are not allowed to execute this method");
      }
     
      final DeclareProtected annotation = method.getAnnotation(DeclareProtected.class);
      if (annotation != null) {
        if (!conn.getClient().hasPermission(conn, annotation.permission())) {
          // Client doesn't have required permission
          if (log.isDebugEnabled()) {
            log.debug("Client " + conn.getClient() +
                " doesn't have required permission " + annotation.permission() +
                " to call " + method);
View Full Code Here

Examples of org.red5.annotations.DeclareProtected.permission()

      if (annotation != null) {
        if (!conn.getClient().hasPermission(conn, annotation.permission())) {
          // Client doesn't have required permission
          if (log.isDebugEnabled()) {
            log.debug("Client " + conn.getClient() +
                " doesn't have required permission " + annotation.permission() +
                " to call " + method);
          }
          throw new NotAllowedException("you are not allowed to execute this method");
        }
      }
View Full Code Here

Examples of org.sonar.core.permission.PermissionQuery.permission()

    ArgumentCaptor<PermissionQuery> argumentCaptor = ArgumentCaptor.forClass(PermissionQuery.class);
    verify(finder).findUsersWithPermission(argumentCaptor.capture());

    PermissionQuery query = argumentCaptor.getValue();
    assertThat(query.component()).isEqualTo("org.sample.Sample");
    assertThat(query.permission()).isEqualTo("user");
    assertThat(query.membership()).isEqualTo(PermissionQuery.ANY);
  }

  @Test
  public void find_groups_with_permissions() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.