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 2ba134ab
authored
Jun 06, 2014
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kuvien uploadaus toimimaan anomuuminäytöille. Skipattu permissiotarkistuksia.
1 parent
c67cbe61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
code/MoyaWeb/WebContent/admin/adduser/index.xhtml → code/MoyaWeb/WebContent/admin/adduser/index.html
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
View file @
2ba134a
...
@@ -259,14 +259,15 @@ public class UserBean implements UserBeanLocal {
...
@@ -259,14 +259,15 @@ public class UserBean implements UserBeanLocal {
}
}
@Override
@Override
@RolesAllowed
(
SpecialPermission
.
S_USER
)
//@RolesAllowed(SpecialPermission.S_USER) // Skip check in Vectorama2014
public
UserImage
uploadImage
(
EventUser
user
,
String
contentType
,
InputStream
imagestream
,
String
filename
,
String
description
)
{
public
UserImage
uploadImage
(
EventUser
user
,
String
contentType
,
InputStream
imagestream
,
String
filename
,
String
description
)
{
user
=
eventUserFacade
.
merge
(
user
);
user
=
eventUserFacade
.
merge
(
user
);
logger
.
debug
(
"uploading image to userid {}"
,
user
);
logger
.
debug
(
"uploading image to userid {}"
,
user
);
EventUser
curruser
=
permbean
.
getCurrentUser
();
EventUser
curruser
=
permbean
.
getCurrentUser
();
if
(!
curruser
.
equals
(
user
)
&&
!
permbean
.
hasPermission
(
UserPermission
.
MODIFY
))
{
// XXX: Allow anonymous to upload pictures. Vectorama2014.
if
(
curruser
.
isAnonymous
()
==
false
&&
!
curruser
.
equals
(
user
)
&&
!
permbean
.
hasPermission
(
UserPermission
.
MODIFY
))
{
loggerbean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
curruser
,
"user tried to save picture to userid "
+
user
+
" without sufficient permissions!"
);
loggerbean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
curruser
,
"user tried to save picture to userid "
+
user
+
" without sufficient permissions!"
);
throw
new
EJBAccessException
(
"No permission to upload image as another user"
);
throw
new
EJBAccessException
(
"No permission to upload image as another user"
);
}
}
...
...
code/MoyaWeb/WebContent/admin/adduser/index.
x
html
→
code/MoyaWeb/WebContent/admin/adduser/index.html
View file @
2ba134a
File moved
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