Results 1 to 6 of 6

Thread: authorize role users with spring security

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    5

    Default authorize role users with spring security

    Hello,

    I am looking for a way to manage commentt authorization rights and access to the user that all depant onscreen user's role,
    in fact I use spring security jsf 2 and 3, the following is my code but when I run nothing appears or has changed:
    *********************page.xhtlm******************
    []<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:sec="http://www.springframework.org/security/tags">
    <sec:authorize ifAnyGranted="ROLE_PARTICIPANT">
    <rich:menuItem
    onclick="document.location.href='Gest-utilisateur1.jsf'">
    <h:outputLink value="Gest-utilisateur1.jsf">
    <h:outputText value="Gestion des utilisateurs"></h:outputText>
    </h:outputLink>
    </rich:menuItem>
    <rich:menuItem
    onclick="document.location.href='GestConsult-groupe1.jsf'">
    <h:outputLink value="Gest-groupe1.jsf">
    <h:outputText value="Gestion des groupes"></h:outputText>
    </h:outputLink>
    </rich:menuItem>
    </sec:authorize >
    <sec:authorize access="hasRole('ROLE_ADMIN')">

    <h:outputText value="XXXXXX"></h:outputText>
    </sec:authorize>
    [/CODE]
    but nothing changes, please let me know every information that can help me and thank you

  2. #2
    Join Date
    Jan 2008
    Posts
    1,833

    Default

    Rob Winch
    Twitter @rob_winch
    Spring Security Lead
    Spring by Pivotal

  3. #3
    Join Date
    Aug 2012
    Posts
    5

    Default

    hello,

    I checked this link but still I have not solved my problem of managing access rights to application menus with Spring
    Security3..
    I don't know exactly what I need to add as a tag in the file, or I have to create a java class?
    enyone can help me please??

  4. #4
    Join Date
    Jan 2008
    Posts
    1,833

    Default

    Have you ran the working examples? Did you remember to update the tag definitions? Can you expand on what you mean by nothing changes?
    Rob Winch
    Twitter @rob_winch
    Spring Security Lead
    Spring by Pivotal

  5. #5
    Join Date
    Aug 2012
    Posts
    5

    Default response

    Good morning,


    I mean the example that you have mentioned do not answer my question, it does not even contain the tags <security:intercept-url> I can give access through roles that I have.
    I am looking for a detailed example that helps me solve my problème.In fact I am a beginner in spring security and I do not really mind,
    thank you very much

  6. #6
    Join Date
    Jan 2008
    Posts
    1,833

    Default

    I can't help you if you do not answer my questions. Your best bet is to read the documentation. If you have a specific problem, make sure you give details about what you expect to happen, what is actually happening, and what you have tried.
    Last edited by Rob Winch; Sep 4th, 2012 at 10:05 AM.
    Rob Winch
    Twitter @rob_winch
    Spring Security Lead
    Spring by Pivotal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •