Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2366cd98
authored
Jul 19, 2014
by
Antti Tönkyrä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tournament admin functionality to deletes, no UI yet
1 parent
0699436d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
View file @
2366cd9
...
...
@@ -234,14 +234,14 @@ public class TournamentBean implements TournamentBeanLocal {
EventUser
executor
=
permissionBean
.
getCurrentUser
();
// Assert we have permission to remove participant
// TODO: this will include check for remove any participation too!
if
(!
permissionBean
.
hasPermission
(
TournamentPermission
.
REMOVE_OWN_PARTICIPATION
)
||
!
tp
.
getParticipator
().
equals
(
executor
))
{
if
(
permissionBean
.
hasPermission
(
TournamentPermission
.
REMOVE_OWN_PARTICIPATION
)
&&
tp
.
getParticipator
().
equals
(
executor
))
{
throw
new
Exception
(
"tournaments.can_only_remove_own_participations"
);
}
else
if
(!
tp
.
getParticipator
().
equals
(
executor
)
&&
permissionBean
.
hasPermission
(
TournamentPermission
.
MANAGE_ALL
))
{
throw
new
Exception
(
"tournaments.cannot_remove_others_participations"
);
}
// Assert that tournament has not closed participation
// TODO: admin exception!
if
(!
tp
.
getTournament
().
getRegistrationClosesAt
().
after
(
new
Date
()))
{
if
(!
permissionBean
.
hasPermission
(
TournamentPermission
.
MANAGE_ALL
)
&&
!
tp
.
getTournament
().
getRegistrationClosesAt
().
after
(
new
Date
()))
{
throw
new
Exception
(
"tournaments.cannot_remove_participation_from_closed_tournament"
);
}
...
...
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