📄 mvnforumpermission.java
字号:
/* * Copyright (C) 2002 by MyVietnam.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * All copyright notices regarding mvnForum * must remain intact in the scripts and in the outputted HTML * The "powered by" text/logo with a link back to * http://www.mvnForum.com and http://www.MyVietnam.net in the footer of the pages MUST * remain visible when the pages are viewed on the internet or intranet. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Support can be obtained from support forums at: * http://www.mvnForum.com/mvnforum/index * * Correspondence and Marketing Questions can be sent to: * info@MyVietnam.net * * @author: Minh Nguyen minhnn@MyVietnam.net * @author: Mai Nguyen mai.nh@MyVietnam.net */package net.myvietnam.mvnplugin.mvnforum.auth;public interface MVNForumPermission {/************************************************************************** * Below are constant, once a constant have been assigned * a value, it can not be changed. **************************************************************************//************************************************************************** * Special permissions, range from 0 to 99 **************************************************************************/ /** * No permission, just use to reserved the value 0 * Normally, this permission should never be used. */ public static final int PERMISSION_EMPTY = 0; /** * All users will have this permission once they have logged in. */ public static final int PERMISSION_AUTHENTICATED = 1; /** * If a user have this permission, it means he is revoked all permissions * This permission is still reserved for future uses. */ public static final int PERMISSION_NO_PERMISSIONS = 2;/************************************************************************** * Combined permissions, range from 100 to 199 * A permission in this range is the combination of other permissions **************************************************************************/ /** * This permission is combination of all permissions, * but excludes all special permissions. */ public static final int PERMISSION_SYSTEM_ADMIN = 100; /** */ public static final int PERMISSION_GROUP_ADMIN = 101; /** */ public static final int PERMISSION_GROUP_MODERATOR = 102; /** */ public static final int PERMISSION_USER_ADMIN = 103; /** */ public static final int PERMISSION_USER_MODERATOR = 104; /** */ public static final int PERMISSION_FORUM_ADMIN = 105; /** */ public static final int PERMISSION_FORUM_MODERATOR = 106; /** * Reserved */ public static final int PERMISSION_CATEGORY_ADMIN = 107; /** * Reserved */ public static final int PERMISSION_CATEGORY_MODERATOR = 108; /** * Can: * - login, read thread and post, reply to a thread */ public static final int PERMISSION_LIMITED_USER = 109; /** * Can: * - login, read thread and post, reply to a thread * - new thread, use avatar, get attachment */ public static final int PERMISSION_NORMAL_USER = 110; /** * Can: * - login, read thread and post, reply to a thread * - new thread, use avatar, get attachment * - use attachment, create poll */ public static final int PERMISSION_POWER_USER = 111;/************************************************************************** * Individual Permissions, range begin at 1000 * A permission in this range is an single permission * A Combined Permission usually includes some Individual Permissions **************************************************************************//************************************************************************** * Individual Permissions for global usages, range from 1000 to 2000 **************************************************************************/ /** @todo assign number for these permissions */ /** * Login */ public static final int PERMISSION_LOGIN = 1000; /** * Admin the system */ public static final int PERMISSION_ADMIN_SYSTEM = 1000; /** * New a Forum */ public static final int PERMISSION_NEW_FORUM = 1000; /** * Edit a Forum */ public static final int PERMISSION_EDIT_FORUM = 1000; /** * Delete a Forum */ public static final int PERMISSION_DELETE_FORUM = 1000; /** * New a Category */ public static final int PERMISSION_NEW_CATEGORY = 1000; /** * Edit a Category */ public static final int PERMISSION_EDIT_CATEGORY = 1000; /** * Delete a Category */ public static final int PERMISSION_DELETE_CATEGORY = 1000; /** * Delete a Category */ public static final int PERMISSION_SEND_MAIL = 1000; /** * Use private message */ public static final int PERMISSION_USE_MESSAGE = 1000; /** * Use private message */ public static final int PERMISSION_USE_AVATAR = 1000;/************************************************************************** * Individual Permissions that can be applied for individual forum usages, * (of course it can be applied to all forums), range from 2000 to 3000 **************************************************************************/ /** * Read post in the forum */ public static final int PERMISSION_READ_POST = 2000; /** * Create new thread */ public static final int PERMISSION_NEW_THREAD = 2001; /** * Create a new post (reply to a thread) */ public static final int PERMISSION_NEW_POST = 2002; /** * Edit post in the forum */ public static final int PERMISSION_EDIT_POST = 2003; /** * Delete post in the forum */ public static final int PERMISSION_DELETE_POST = 2004; /** * Create a new poll */ public static final int PERMISSION_NEW_POLL = 2005; /** * Create a new poll */ public static final int PERMISSION_EDIT_POLL = 2006; /** * Create a new poll */ public static final int PERMISSION_DELETE_POLL = 2007; /** * Can attach files when posting */ public static final int PERMISSION_USE_ATTACHMENT = 2008; /** * Can download attached files */ public static final int PERMISSION_GET_ATTACHMENT = 2009;/************************************************************************** * Special permissions methods **************************************************************************/ public boolean isAuthenticated(); public void ensureIsAuthenticated() throws AuthenticationException;/************************************************************************** * The below methods are used to check global permissions **************************************************************************/ public boolean canLogin(); public void ensureCanLogin() throws AuthenticationException; public boolean canAdminSystem(); public void ensureCanAdminSystem() throws AuthenticationException; public boolean canNewForum(); public void ensureCanNewForum() throws AuthenticationException; public boolean canEditForum(); public void ensureCanEditForum() throws AuthenticationException; public boolean canDeleteForum(); public void ensureCanDeleteForum() throws AuthenticationException; public boolean canNewCategory(); public void ensureCanNewCategory() throws AuthenticationException; public boolean canEditCategory(); public void ensureCanEditCategory() throws AuthenticationException; public boolean canDeleteCategory(); public void ensureCanDeleteCategory() throws AuthenticationException; public boolean canSendMail(); public void ensureCanSendMail() throws AuthenticationException; public boolean canUseAvatar(); public void ensureCanUseAvatar() throws AuthenticationException; public boolean canUseMessage(); public void ensureCanUseMessage() throws AuthenticationException;/************************************************************************** * The below methods are used to check individual forum permissions **************************************************************************/ public boolean canReadPost(int forumID); public void ensureCanReadPost(int forumID) throws AuthenticationException; public boolean canNewThread(int forumID); public void ensureCanNewThread(int forumID) throws AuthenticationException; public boolean canNewPost(int forumID); public void ensureCanNewPost(int forumID) throws AuthenticationException; public boolean canEditPost(int forumID); public void ensureCanEditPost(int forumID) throws AuthenticationException; public boolean canDeletePost(int forumID); public void ensureCanDeletePost(int forumID) throws AuthenticationException; public boolean canNewPoll(int forumID); public void ensureCanNewPoll(int forumID) throws AuthenticationException; public boolean canEditPoll(int forumID); public void ensureCanEditPoll(int forumID) throws AuthenticationException; public boolean canDeletePoll(int forumID); public void ensureCanDeletePoll(int forumID) throws AuthenticationException; public boolean canUseAttachment(int forumID); public void ensureCanUseAttachment(int forumID) throws AuthenticationException; public boolean canGetAttachment(int forumID); public void ensureCanGetAttachment(int forumID) throws AuthenticationException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -