net.myvietnam.mvnplugin.mvnforum.auth
Class AbstractPermission

java.lang.Object
  |
  +--net.myvietnam.mvnplugin.mvnforum.auth.AbstractPermission
All Implemented Interfaces:
MVNForumPermission

public abstract class AbstractPermission
extends java.lang.Object
implements MVNForumPermission


Field Summary
protected  boolean adminSystem
           
protected  boolean authenticated
          global permissions variables
protected  boolean deleteCategory
           
protected  boolean deleteForum
           
protected  boolean deletePoll
           
protected  boolean deletePost
           
protected  boolean editCategory
           
protected  boolean editForum
           
protected  boolean editPoll
           
protected  boolean editPost
           
static int[] forumPermissionArray
           
protected  boolean getAttachment
           
static int[] globalPermissionArray
           
protected  boolean login
           
protected  boolean newCategory
           
protected  boolean newForum
           
protected  boolean newPoll
           
protected  boolean newPost
           
protected  boolean newThread
           
protected  boolean readPost
           
protected  boolean sendMail
           
protected  boolean useAttachment
           
protected  boolean useAvatar
           
protected  boolean useMessage
           
 
Fields inherited from interface net.myvietnam.mvnplugin.mvnforum.auth.MVNForumPermission
PERMISSION_AUTHENTICATED, PERMISSION_CATEGORY_ADMIN, PERMISSION_CATEGORY_MODERATOR, PERMISSION_DELETE_CATEGORY, PERMISSION_DELETE_FORUM, PERMISSION_DELETE_POLL, PERMISSION_DELETE_POST, PERMISSION_EDIT_CATEGORY, PERMISSION_EDIT_FORUM, PERMISSION_EDIT_POLL, PERMISSION_EDIT_POST, PERMISSION_EMPTY, PERMISSION_FORUM_ADMIN, PERMISSION_FORUM_MODERATOR, PERMISSION_GET_ATTACHMENT, PERMISSION_GROUP_ADMIN, PERMISSION_GROUP_MODERATOR, PERMISSION_LIMITED_USER, PERMISSION_LOGIN, PERMISSION_NEW_CATEGORY, PERMISSION_NEW_FORUM, PERMISSION_NEW_POLL, PERMISSION_NEW_POST, PERMISSION_NEW_THREAD, PERMISSION_NO_PERMISSIONS, PERMISSION_NORMAL_USER, PERMISSION_POWER_USER, PERMISSION_READ_POST, PERMISSION_SEND_MAIL, PERMISSION_SYSTEM_ADMIN, PERMISSION_USE_ATTACHMENT, PERMISSION_USE_AVATAR, PERMISSION_USE_MESSAGE, PERMISSION_USER_ADMIN, PERMISSION_USER_MODERATOR
 
Constructor Summary
protected AbstractPermission()
          constructor
 
Method Summary
 boolean canAdminSystem()
           
 boolean canDeleteCategory()
           
 boolean canDeleteForum()
           
 boolean canDeletePoll(int forumID)
           
 boolean canDeletePost(int forumID)
           
 boolean canEditCategory()
           
 boolean canEditForum()
           
 boolean canEditPoll(int forumID)
           
 boolean canEditPost(int forumID)
           
 boolean canGetAttachment(int forumID)
           
 boolean canLogin()
          global permissions methods
 boolean canNewCategory()
           
 boolean canNewForum()
           
 boolean canNewPoll(int forumID)
           
 boolean canNewPost(int forumID)
           
 boolean canNewThread(int forumID)
           
 boolean canReadPost(int forumID)
          The below methods are used to check individual forum permissions
 boolean canSendMail()
           
 boolean canUseAttachment(int forumID)
           
 boolean canUseAvatar()
           
 boolean canUseMessage()
           
 void ensureCanAdminSystem()
           
 void ensureCanDeleteCategory()
           
 void ensureCanDeleteForum()
           
 void ensureCanDeletePoll(int forumID)
           
 void ensureCanDeletePost(int forumID)
           
 void ensureCanEditCategory()
           
 void ensureCanEditForum()
           
 void ensureCanEditPoll(int forumID)
           
 void ensureCanEditPost(int forumID)
           
 void ensureCanGetAttachment(int forumID)
           
 void ensureCanLogin()
           
 void ensureCanNewCategory()
           
 void ensureCanNewForum()
           
 void ensureCanNewPoll(int forumID)
           
 void ensureCanNewPost(int forumID)
           
 void ensureCanNewThread(int forumID)
           
 void ensureCanReadPost(int forumID)
           
 void ensureCanSendMail()
           
 void ensureCanUseAttachment(int forumID)
           
 void ensureCanUseAvatar()
           
 void ensureCanUseMessage()
           
 void ensureIsAuthenticated()
           
static java.lang.String getDescription(int permission)
          The below methods are static methods
 boolean isAuthenticated()
          Special permissions methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globalPermissionArray

public static final int[] globalPermissionArray

forumPermissionArray

public static final int[] forumPermissionArray

authenticated

protected boolean authenticated
global permissions variables


login

protected boolean login

adminSystem

protected boolean adminSystem

newForum

protected boolean newForum

editForum

protected boolean editForum

deleteForum

protected boolean deleteForum

newCategory

protected boolean newCategory

editCategory

protected boolean editCategory

deleteCategory

protected boolean deleteCategory

sendMail

protected boolean sendMail

useAvatar

protected boolean useAvatar

useMessage

protected boolean useMessage

readPost

protected boolean readPost

newThread

protected boolean newThread

newPost

protected boolean newPost

editPost

protected boolean editPost

deletePost

protected boolean deletePost

newPoll

protected boolean newPoll

editPoll

protected boolean editPoll

deletePoll

protected boolean deletePoll

useAttachment

protected boolean useAttachment

getAttachment

protected boolean getAttachment
Constructor Detail

AbstractPermission

protected AbstractPermission()
constructor

Method Detail

getDescription

public static java.lang.String getDescription(int permission)
                                       throws net.myvietnam.mvncore.exception.BadInputException
The below methods are static methods

net.myvietnam.mvncore.exception.BadInputException

isAuthenticated

public boolean isAuthenticated()
Special permissions methods

Specified by:
isAuthenticated in interface MVNForumPermission

ensureIsAuthenticated

public void ensureIsAuthenticated()
                           throws AuthenticationException
Specified by:
ensureIsAuthenticated in interface MVNForumPermission
AuthenticationException

canLogin

public boolean canLogin()
global permissions methods

Specified by:
canLogin in interface MVNForumPermission

ensureCanLogin

public void ensureCanLogin()
                    throws AuthenticationException
Specified by:
ensureCanLogin in interface MVNForumPermission
AuthenticationException

canAdminSystem

public boolean canAdminSystem()
Specified by:
canAdminSystem in interface MVNForumPermission

ensureCanAdminSystem

public void ensureCanAdminSystem()
                          throws AuthenticationException
Specified by:
ensureCanAdminSystem in interface MVNForumPermission
AuthenticationException

canNewForum

public boolean canNewForum()
Specified by:
canNewForum in interface MVNForumPermission

ensureCanNewForum

public void ensureCanNewForum()
                       throws AuthenticationException
Specified by:
ensureCanNewForum in interface MVNForumPermission
AuthenticationException

canEditForum

public boolean canEditForum()
Specified by:
canEditForum in interface MVNForumPermission

ensureCanEditForum

public void ensureCanEditForum()
                        throws AuthenticationException
Specified by:
ensureCanEditForum in interface MVNForumPermission
AuthenticationException

canDeleteForum

public boolean canDeleteForum()
Specified by:
canDeleteForum in interface MVNForumPermission

ensureCanDeleteForum

public void ensureCanDeleteForum()
                          throws AuthenticationException
Specified by:
ensureCanDeleteForum in interface MVNForumPermission
AuthenticationException

canNewCategory

public boolean canNewCategory()
Specified by:
canNewCategory in interface MVNForumPermission

ensureCanNewCategory

public void ensureCanNewCategory()
                          throws AuthenticationException
Specified by:
ensureCanNewCategory in interface MVNForumPermission
AuthenticationException

canEditCategory

public boolean canEditCategory()
Specified by:
canEditCategory in interface MVNForumPermission

ensureCanEditCategory

public void ensureCanEditCategory()
                           throws AuthenticationException
Specified by:
ensureCanEditCategory in interface MVNForumPermission
AuthenticationException

canDeleteCategory

public boolean canDeleteCategory()
Specified by:
canDeleteCategory in interface MVNForumPermission

ensureCanDeleteCategory

public void ensureCanDeleteCategory()
                             throws AuthenticationException
Specified by:
ensureCanDeleteCategory in interface MVNForumPermission
AuthenticationException

canSendMail

public boolean canSendMail()
Specified by:
canSendMail in interface MVNForumPermission

ensureCanSendMail

public void ensureCanSendMail()
                       throws AuthenticationException
Specified by:
ensureCanSendMail in interface MVNForumPermission
AuthenticationException

canUseAvatar

public boolean canUseAvatar()
Specified by:
canUseAvatar in interface MVNForumPermission

ensureCanUseAvatar

public void ensureCanUseAvatar()
                        throws AuthenticationException
Specified by:
ensureCanUseAvatar in interface MVNForumPermission
AuthenticationException

canUseMessage

public boolean canUseMessage()
Specified by:
canUseMessage in interface MVNForumPermission

ensureCanUseMessage

public void ensureCanUseMessage()
                         throws AuthenticationException
Specified by:
ensureCanUseMessage in interface MVNForumPermission
AuthenticationException

canReadPost

public boolean canReadPost(int forumID)
Description copied from interface: MVNForumPermission
The below methods are used to check individual forum permissions

Specified by:
canReadPost in interface MVNForumPermission

ensureCanReadPost

public void ensureCanReadPost(int forumID)
                       throws AuthenticationException
Specified by:
ensureCanReadPost in interface MVNForumPermission
AuthenticationException

canNewThread

public boolean canNewThread(int forumID)
Specified by:
canNewThread in interface MVNForumPermission

ensureCanNewThread

public void ensureCanNewThread(int forumID)
                        throws AuthenticationException
Specified by:
ensureCanNewThread in interface MVNForumPermission
AuthenticationException

canNewPost

public boolean canNewPost(int forumID)
Specified by:
canNewPost in interface MVNForumPermission

ensureCanNewPost

public void ensureCanNewPost(int forumID)
                      throws AuthenticationException
Specified by:
ensureCanNewPost in interface MVNForumPermission
AuthenticationException

canEditPost

public boolean canEditPost(int forumID)
Specified by:
canEditPost in interface MVNForumPermission

ensureCanEditPost

public void ensureCanEditPost(int forumID)
                       throws AuthenticationException
Specified by:
ensureCanEditPost in interface MVNForumPermission
AuthenticationException

canDeletePost

public boolean canDeletePost(int forumID)
Specified by:
canDeletePost in interface MVNForumPermission

ensureCanDeletePost

public void ensureCanDeletePost(int forumID)
                         throws AuthenticationException
Specified by:
ensureCanDeletePost in interface MVNForumPermission
AuthenticationException

canNewPoll

public boolean canNewPoll(int forumID)
Specified by:
canNewPoll in interface MVNForumPermission

ensureCanNewPoll

public void ensureCanNewPoll(int forumID)
                      throws AuthenticationException
Specified by:
ensureCanNewPoll in interface MVNForumPermission
AuthenticationException

canEditPoll

public boolean canEditPoll(int forumID)
Specified by:
canEditPoll in interface MVNForumPermission

ensureCanEditPoll

public void ensureCanEditPoll(int forumID)
                       throws AuthenticationException
Specified by:
ensureCanEditPoll in interface MVNForumPermission
AuthenticationException

canDeletePoll

public boolean canDeletePoll(int forumID)
Specified by:
canDeletePoll in interface MVNForumPermission

ensureCanDeletePoll

public void ensureCanDeletePoll(int forumID)
                         throws AuthenticationException
Specified by:
ensureCanDeletePoll in interface MVNForumPermission
AuthenticationException

canUseAttachment

public boolean canUseAttachment(int forumID)
Specified by:
canUseAttachment in interface MVNForumPermission

ensureCanUseAttachment

public void ensureCanUseAttachment(int forumID)
                            throws AuthenticationException
Specified by:
ensureCanUseAttachment in interface MVNForumPermission
AuthenticationException

canGetAttachment

public boolean canGetAttachment(int forumID)
Specified by:
canGetAttachment in interface MVNForumPermission

ensureCanGetAttachment

public void ensureCanGetAttachment(int forumID)
                            throws AuthenticationException
Specified by:
ensureCanGetAttachment in interface MVNForumPermission
AuthenticationException