Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb
In directory sc8-pr-cvs1:/tmp/cvs-serv22275/src/org/asturlinux/frade/prolix/ejb/sessionjb
Modified Files:
ProlixMainBean.java
Log Message:
Updated users management schema - Addded Permissions class with constants
Index: ProlixMainBean.java
===================================================================
RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb/ProlixMainBean.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** ProlixMainBean.java 2 Aug 2003 20:28:18 -0000 1.27
--- ProlixMainBean.java 3 Aug 2003 21:35:32 -0000 1.28
***************
*** 35,38 ****
--- 35,39 ----
import org.asturlinux.frade.prolix.ejb.interfaces.UserLocalHome;
import org.asturlinux.frade.prolix.ejb.interfaces.UserLocal;
+ import org.asturlinux.frade.prolix.ejb.entityjb.Permissions;
/**
***************
*** 77,81 ****
throws LexicalException, SyntaxException, NotEnoughtPermissionsException
{
! verifyPermissions();
_program = program;
--- 78,82 ----
throws LexicalException, SyntaxException, NotEnoughtPermissionsException
{
! verifyPermissions(Permissions.Guest);
_program = program;
***************
*** 122,126 ****
ProgramNotLoadedException, NotEnoughtPermissionsException
{
! verifyPermissions();
_consult = consult;
--- 123,127 ----
ProgramNotLoadedException, NotEnoughtPermissionsException
{
! verifyPermissions(Permissions.Student);
_consult = consult;
***************
*** 150,154 ****
NotEnoughtPermissionsException
{
! verifyPermissions();
CheckSolutionVisitor visitor = new CheckSolutionVisitor();
--- 151,155 ----
NotEnoughtPermissionsException
{
! verifyPermissions(Permissions.Student);
CheckSolutionVisitor visitor = new CheckSolutionVisitor();
***************
*** 174,178 ****
NotEnoughtPermissionsException
{
! verifyPermissions();
TreeElement treeResult = prologCtx.step();
--- 175,179 ----
NotEnoughtPermissionsException
{
! verifyPermissions(Permissions.Student);
TreeElement treeResult = prologCtx.step();
***************
*** 449,457 ****
}
! private void verifyPermissions()
throws NotEnoughtPermissionsException
{
! //FIXME: Very simple permission schema
! if (loggedUser == null)
throw new NotEnoughtPermissionsException();
}
--- 450,457 ----
}
! private void verifyPermissions(String required)
throws NotEnoughtPermissionsException
{
! if (! loggedUser.getPermissions().matches("*"+required+"*"))
throw new NotEnoughtPermissionsException();
}
|