Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 66344b41
authored
Mar 21, 2010
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some nice examble
1 parent
d8809b16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
55 deletions
code/LanBortalWeb/WebContent/resources/tools/user/list.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/handler/SessionHandler.java
code/LanBortalWeb/WebContent/resources/tools/user/list.xhtml
View file @
66344b4
...
...
@@ -17,59 +17,70 @@
<composite:implementation>
<h:form>
<h:dataTable
border=
"1"
id=
"user"
value=
"#{userView.users}"
var=
"user"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Id"
/>
</f:facet>
<h:outputText
value=
"#{user.id}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Real name"
/>
</f:facet>
<h:outputText
value=
"#{user.firstnames}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Address"
/>
</f:facet>
<h:outputText
value=
"#{user.address}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Town"
/>
</f:facet>
<h:outputText
value=
"#{user.town}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Zip"
/>
</f:facet>
<h:outputText
value=
"#{user.zip}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Phone number"
/>
</f:facet>
<h:outputText
value=
"#{user.phone}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Sex"
/>
</f:facet>
<h:outputText
value=
"#{user.female}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Edit"
/>
</f:facet>
<h:commandButton
action=
"#{userView.edit()}"
value=
"Edit"
/>
</h:column>
</h:dataTable>
</h:form>
<c:choose>
<c:when
test=
'#{sessionHandler.hasPermission("userList", "read") }'
>
<h:dataTable
border=
"1"
id=
"user"
value=
"#{userView.users}"
var=
"user"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Id"
/>
</f:facet>
<h:outputText
value=
"#{user.id}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Real name"
/>
</f:facet>
<h:outputText
value=
"#{user.firstnames}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Address"
/>
</f:facet>
<h:outputText
value=
"#{user.address}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Town"
/>
</f:facet>
<h:outputText
value=
"#{user.town}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Zip"
/>
</f:facet>
<h:outputText
value=
"#{user.zip}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Phone number"
/>
</f:facet>
<h:outputText
value=
"#{user.phone}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Sex"
/>
</f:facet>
<h:outputText
value=
"#{user.female}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Edit"
/>
</f:facet>
<h:commandButton
action=
"#{userView.edit()}"
value=
"Edit"
/>
</h:column>
</h:dataTable>
</c:when>
<c:otherwise>
TODO: some nice message to user.
</c:otherwise>
</c:choose>
</h:form>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/handler/SessionHandler.java
View file @
66344b4
...
...
@@ -18,7 +18,7 @@ import fi.insomnia.bortal.model.User;
*
* @author tuukka
*/
@ManagedBean
(
name
=
"
S
essionHandler"
)
@ManagedBean
(
name
=
"
s
essionHandler"
)
@SessionScoped
public
class
SessionHandler
{
...
...
@@ -43,8 +43,8 @@ public class SessionHandler {
}
public
boolean
hasPermission
(
String
target
,
RolePermission
permission
)
{
return
handlerbean
.
hasPermission
(
target
,
getUser
(),
permission
);
return
false
;
//
return handlerbean.hasPermission(target, getUser(), permission);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment