Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 66e52b21
authored
Jun 09, 2015
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
viplist permission checks
1 parent
cbdc411d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/VipBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/VipBean.java
View file @
66e52b2
...
...
@@ -57,6 +57,7 @@ public class VipBean implements VipBeanLocal {
}
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
void
create
(
Vip
vip
)
{
vip
.
setCreated
(
new
Date
());
vip
.
setCreator
(
permbean
.
getCurrentUser
());
...
...
@@ -69,12 +70,14 @@ public class VipBean implements VipBeanLocal {
}
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
void
delete
(
Vip
vip
)
{
vip
=
vipFacade
.
merge
(
vip
);
vipFacade
.
remove
(
vip
);
}
@Override
@RolesAllowed
({
VipPermission
.
S_VIEW
})
public
Vip
find
(
Integer
id
)
{
return
vipFacade
.
find
(
id
);
}
...
...
@@ -86,6 +89,7 @@ public class VipBean implements VipBeanLocal {
// }
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
Vip
createProduct
(
VipProduct
l
)
{
Vip
vip
=
vipFacade
.
reload
(
l
.
getVip
());
l
.
setVip
(
vip
);
...
...
@@ -98,23 +102,27 @@ public class VipBean implements VipBeanLocal {
}
@Override
@RolesAllowed
({
VipPermission
.
S_VIEW
})
public
SearchResult
<
Vip
>
search
(
SearchQuery
sq
)
{
// TODO Auto-generated method stub
return
null
;
}
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
Vip
save
(
Vip
vip
)
{
return
vipFacade
.
merge
(
vip
);
}
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
Vip
saveProduct
(
VipProduct
prod
)
{
VipProduct
ret
=
vipProductFacade
.
merge
(
prod
);
return
ret
.
getVip
();
}
@Override
@RolesAllowed
({
VipPermission
.
S_EDIT
})
public
Vip
deleteProduct
(
VipProduct
l
)
{
l
=
vipProductFacade
.
reload
(
l
);
Vip
vip
=
l
.
getVip
();
...
...
@@ -124,6 +132,7 @@ public class VipBean implements VipBeanLocal {
}
@Override
@RolesAllowed
({
VipPermission
.
S_USAGE
})
public
VipProductDelivery
createDelivery
(
VipProduct
prod
,
BigDecimal
quantity
,
String
notes
)
{
prod
=
vipProductFacade
.
reload
(
prod
);
...
...
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