Examples of Authorization


Examples of org.osgi.service.useradmin.Authorization

        Role user = m_userAdmin.createRole("user", Role.USER);

        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addMember(user);

        Authorization auth = m_userAdmin.getAuthorization(null);
        assertTrue(auth.hasRole(Role.USER_ANYONE));
        assertFalse(auth.hasRole("group"));
    }
View Full Code Here

Examples of org.osgi.service.useradmin.Authorization

       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(m_userAdmin.getRole(Role.USER_ANYONE));

        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertTrue(auth.hasRole("group"));

        auth = m_userAdmin.getAuthorization(user2);
        assertTrue(auth.hasRole("group"));

        auth = m_userAdmin.getAuthorization(user3);
        assertFalse(auth.hasRole("group"));

        auth = m_userAdmin.getAuthorization(user4);
        assertFalse(auth.hasRole("group"));
    }
View Full Code Here

Examples of org.osgi.service.useradmin.Authorization

        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);

        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertFalse(auth.hasRole("group"));

        auth = m_userAdmin.getAuthorization(user2);
        assertFalse(auth.hasRole("group"));
       
        auth = m_userAdmin.getAuthorization(user3);
        assertFalse(auth.hasRole("group"));
    }
View Full Code Here

Examples of org.osgi.service.useradmin.Authorization

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);

        assertTrue(group1.addRequiredMember(user1));
        assertTrue(group1.addMember(userAnyone));
       
        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertNotNull(auth);
       
        assertTrue(auth.hasRole("group1"));
       
        String[] roles = auth.getRoles();
        assertNotNull(roles);
       
        for (int i = 0; i < roles.length; i++) {
            assertFalse(Role.USER_ANYONE.equals(roles[i]));
        }
View Full Code Here

Examples of org.osgi.service.useradmin.Authorization

    }

    @Override
    public boolean isUserInRole(String role)
    {
        Authorization authorization = (Authorization) getAttribute(HttpContext.AUTHORIZATION);
        if (authorization != null)
        {
            return authorization.hasRole(role);
        }

        return super.isUserInRole(role);
    }
View Full Code Here

Examples of org.thymeleaf.extras.springsecurity3.auth.Authorization

            final ServletContext servletContext = webContext.getServletContext();
           
            if (request != null && response != null && servletContext != null) {
               
                final Authentication authentication = AuthUtils.getAuthenticationObject();
                final Authorization authorization =
                        new Authorization(processingContext, authentication, request, response, servletContext);
                       
                objects.put(AUTHENTICATION_EXPRESSION_OBJECT_NAME, authentication);
                objects.put(AUTHORIZATION_EXPRESSION_OBJECT_NAME, authorization);
               
            }
View Full Code Here

Examples of tigase.xmpp.Authorization

            log.warning("User connection does not exist for the request to complete the user transfer: " + packet.toString());
            return;
          }
          String token = (String)conn.getSessionData(TOKEN);
          String xmpp_sessionId = conn.getSessionId();
          Authorization auth_res = null;
          try {
            auth_res = conn.loginToken(xmpp_sessionId, token);
          } catch (Exception e) {
            log.log(Level.WARNING, "Token authentication unsuccessful.", e);
            auth_res = Authorization.NOT_AUTHORIZED;
View Full Code Here

Examples of twitter4j.auth.Authorization

     *
     * @throws TwitterException When Twitter service or network is unavailable, when the user has not authorized, or when the client application is not permitted to use xAuth
     * @see <a href="https://dev.twitter.com/docs/oauth/xauth">xAuth | Twitter Developers</a>
     */
    public synchronized AccessToken getOAuthAccessToken() throws TwitterException {
        Authorization auth = getAuthorization();
        AccessToken oauthAccessToken;
        if (auth instanceof BasicAuthorization) {
            BasicAuthorization basicAuth = (BasicAuthorization) auth;
            auth = AuthorizationFactory.getInstance(conf);
            if (auth instanceof OAuthAuthorization) {
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.