Source Code Cross Referenced for MVNForumPermission.java in  » Forum » mvnforum-1.1 » com » mvnforum » auth » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Forum » mvnforum 1.1 » com.mvnforum.auth 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/auth/MVNForumPermission.java,v 1.48 2007/12/20 06:55:42 minhnn Exp $
0003:         * $Author: minhnn $
0004:         * $Revision: 1.48 $
0005:         * $Date: 2007/12/20 06:55:42 $
0006:         *
0007:         * ====================================================================
0008:         *
0009:         * Copyright (C) 2002-2007 by MyVietnam.net
0010:         *
0011:         * All copyright notices regarding mvnForum MUST remain
0012:         * intact in the scripts and in the outputted HTML.
0013:         * The "powered by" text/logo with a link back to
0014:         * http://www.mvnForum.com and http://www.MyVietnam.net in
0015:         * the footer of the pages MUST remain visible when the pages
0016:         * are viewed on the internet or intranet.
0017:         *
0018:         * This program is free software; you can redistribute it and/or modify
0019:         * it under the terms of the GNU General Public License as published by
0020:         * the Free Software Foundation; either version 2 of the License, or
0021:         * any later version.
0022:         *
0023:         * This program is distributed in the hope that it will be useful,
0024:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
0025:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0026:         * GNU General Public License for more details.
0027:         *
0028:         * You should have received a copy of the GNU General Public License
0029:         * along with this program; if not, write to the Free Software
0030:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0031:         *
0032:         * Support can be obtained from support forums at:
0033:         * http://www.mvnForum.com/mvnforum/index
0034:         *
0035:         * Correspondence and Marketing Questions can be sent to:
0036:         * info at MyVietnam net
0037:         *
0038:         * @author: Minh Nguyen
0039:         * @author: Mai  Nguyen
0040:         */
0041:        package com.mvnforum.auth;
0042:
0043:        public interface MVNForumPermission {
0044:
0045:            /**************************************************************************
0046:             * Below are constant, once a constant have been assigned
0047:             * a value, it CANNOT be changed (for compatibility).
0048:             **************************************************************************/
0049:
0050:            /**************************************************************************
0051:             * Special permissions, range from 0 to 99
0052:             **************************************************************************/
0053:            /**
0054:             * No permission, just use to reserved the value 0
0055:             * Normally, this permission should never be used.
0056:             */
0057:            public static final int PERMISSION_EMPTY = 0;
0058:
0059:            /**
0060:             * All users will have this permission once they have logged in.
0061:             */
0062:            public static final int PERMISSION_AUTHENTICATED = 1;
0063:
0064:            /**
0065:             * If a user have this permission, it means he is revoked all permissions
0066:             * This permission is still reserved for future uses.
0067:             */
0068:            public static final int PERMISSION_NO_PERMISSIONS = 2;
0069:
0070:            /**
0071:             * All users will have this permission once they have logged in
0072:             * and they have activated their account using email activation process
0073:             */
0074:            public static final int PERMISSION_ACTIVATED = 3;
0075:
0076:            /**************************************************************************
0077:             * Combined permissions, range from 100 to 199
0078:             * A permission in this range is the combination of other individual permissions
0079:             * NOTE: values from 200 to (1000-1) are still reserved
0080:             **************************************************************************/
0081:            /**
0082:             * This permission is combination of all permissions,
0083:             * but excludes all special permissions.
0084:             */
0085:            public static final int PERMISSION_SYSTEM_ADMIN = 100;
0086:
0087:            /**
0088:             */
0089:            public static final int PERMISSION_GROUP_ADMIN = 101;
0090:
0091:            /**
0092:             */
0093:            public static final int PERMISSION_GROUP_MODERATOR = 102;
0094:
0095:            /**
0096:             */
0097:            public static final int PERMISSION_USER_ADMIN = 103;
0098:
0099:            /**
0100:             */
0101:            public static final int PERMISSION_USER_MODERATOR = 104;
0102:
0103:            /**
0104:             */
0105:            public static final int PERMISSION_FORUM_ADMIN = 105;
0106:
0107:            /**
0108:             */
0109:            public static final int PERMISSION_FORUM_MODERATOR = 106;
0110:
0111:            /**
0112:             * Reserved
0113:             */
0114:            public static final int PERMISSION_CATEGORY_ADMIN = 107;
0115:
0116:            /**
0117:             * Reserved
0118:             */
0119:            public static final int PERMISSION_CATEGORY_MODERATOR = 108;
0120:
0121:            /**
0122:             * Can:
0123:             * - login, read thread and post, reply to a thread
0124:             */
0125:            public static final int PERMISSION_LIMITED_USER = 109;
0126:
0127:            /**
0128:             * Can:
0129:             * - login, read thread and post, reply to a thread
0130:             * - Add thread, use avatar, get attachment
0131:             */
0132:            public static final int PERMISSION_NORMAL_USER = 110;
0133:
0134:            /**
0135:             * Can:
0136:             * - login, read thread and post, reply to a thread
0137:             * - Add thread, use avatar, get attachment
0138:             * - use attachment, create poll
0139:             */
0140:            public static final int PERMISSION_POWER_USER = 111;
0141:
0142:            /**************************************************************************
0143:             * Individual Permissions, range begin at 1000
0144:             * A permission in this range is an single permission
0145:             * A Combined Permission usually includes some Individual Permissions
0146:             **************************************************************************/
0147:
0148:            /**************************************************************************
0149:             * Individual Permissions for global usages, range from 1000 to (2000-1)
0150:             * NOTE: values from 2000 and above are still reserved
0151:             **************************************************************************/
0152:            /**************************************************************************
0153:             * Individual Global Permissions which high-level permission, range from 1000 to (1100-1)
0154:             **************************************************************************/
0155:            /**
0156:             * Login
0157:             */
0158:            public static final int PERMISSION_LOGIN = 1000;
0159:
0160:            /**
0161:             * Admin the system, this permission should not be used
0162:             * instead, use the combined PERMISSION_SYSTEM_ADMIN
0163:             */
0164:            //public static final int PERMISSION_ADMIN_SYSTEM         = 1001;
0165:            /**
0166:             * Add a Forum
0167:             */
0168:            public static final int PERMISSION_ADD_FORUM = 1002;
0169:
0170:            /**
0171:             * Add a Category
0172:             */
0173:            public static final int PERMISSION_ADD_CATEGORY = 1003;
0174:
0175:            /**
0176:             * Edit a Category
0177:             */
0178:            public static final int PERMISSION_EDIT_CATEGORY = 1004;
0179:
0180:            /**
0181:             * Delete a Category
0182:             */
0183:            public static final int PERMISSION_DELETE_CATEGORY = 1005;
0184:
0185:            /**
0186:             * Send Mail
0187:             */
0188:            public static final int PERMISSION_SEND_MAIL = 1006;
0189:
0190:            /**
0191:             * Permission to bypass/ignore the private forum
0192:             */
0193:            public static final int PERMISSION_BYPASS_PRIVATE_FORUM = 1007;
0194:
0195:            /**
0196:             * Moderate User (can reset avatar, reset signature, disable user, etc)
0197:             */
0198:            public static final int PERMISSION_MODERATE_USER = 1008;
0199:
0200:            /**************************************************************************
0201:             * Individual Global Permissions which low-level permission, range from 1100 to (2000-1)
0202:             **************************************************************************/
0203:            /**
0204:             * Use Private Message
0205:             */
0206:            public static final int PERMISSION_USE_MESSAGE = 1100;
0207:
0208:            /**
0209:             * Use Avatar
0210:             */
0211:            public static final int PERMISSION_USE_AVATAR = 1101;
0212:
0213:            /**
0214:             * Use (upload) Attachment in Private Message
0215:             */
0216:            public static final int PERMISSION_ADD_MESSAGE_ATTACHMENT = 1102;
0217:
0218:            /**
0219:             * Use Album
0220:             */
0221:            public static final int PERMISSION_USE_ALBUM = 1103;
0222:
0223:            /**
0224:             * Can manage orphan poll
0225:             */
0226:            public static final int PERMISSION_MANAGE_ORPHAN_POLL = 1104;
0227:
0228:            /**
0229:             * Can manage album item poll
0230:             */
0231:            public static final int PERMISSION_MANAGE_ALBUMITEM_POLL = 1105;
0232:
0233:            /**
0234:             * Can set poll to anonymous type
0235:             */
0236:            public static final int PERMISSION_SET_POLL_TO_ANONYMOUS_TYPE = 1106;
0237:
0238:            /**************************************************************************
0239:             * Individual Permissions that can be applied for individual forum usages,
0240:             * (of course it can be applied to all forums), range from 2000 to (3000-1)
0241:             **************************************************************************/
0242:            /**************************************************************************
0243:             * Individual Permissions which high-level permission, range from 2000 to (2100-1)
0244:             * Usually Forum Admin has these permissions
0245:             **************************************************************************/
0246:            /**
0247:             * Edit a Forum
0248:             */
0249:            public static final int PERMISSION_EDIT_FORUM = 2000;
0250:
0251:            /**
0252:             * Delete a Forum
0253:             */
0254:            public static final int PERMISSION_DELETE_FORUM = 2001;
0255:
0256:            /**
0257:             * Assign permission
0258:             */
0259:            public static final int PERMISSION_ASSIGN_TO_FORUM = 2002;
0260:
0261:            /**************************************************************************
0262:             * Individual Permissions which low-level permission, range from (2100 to 3000-1)
0263:             **************************************************************************/
0264:            /**
0265:             * Read post in the forum
0266:             */
0267:            public static final int PERMISSION_READ_POST = 2100;
0268:
0269:            /**
0270:             * Create add thread
0271:             */
0272:            public static final int PERMISSION_ADD_THREAD = 2101;
0273:
0274:            /**
0275:             * Add a post (reply to a thread)
0276:             */
0277:            public static final int PERMISSION_ADD_POST = 2102;
0278:
0279:            /**
0280:             * Edit post in the forum
0281:             * This permission allow edit all posts and attach all files to the post
0282:             */
0283:            public static final int PERMISSION_EDIT_POST = 2103;
0284:
0285:            /**
0286:             * Delete post in the forum
0287:             */
0288:            public static final int PERMISSION_DELETE_POST = 2104;
0289:
0290:            /**
0291:             * Add a poll
0292:             */
0293:            public static final int PERMISSION_ADD_POLL = 2105;
0294:
0295:            /**
0296:             * Edit a poll
0297:             */
0298:            public static final int PERMISSION_EDIT_POLL = 2106;
0299:
0300:            /**
0301:             * Delete a poll
0302:             */
0303:            public static final int PERMISSION_DELETE_POLL = 2107;
0304:
0305:            /**
0306:             * Can attach files when posting
0307:             */
0308:            public static final int PERMISSION_ADD_ATTACHMENT = 2108;
0309:
0310:            /**
0311:             * Can download attached files
0312:             */
0313:            public static final int PERMISSION_GET_ATTACHMENT = 2109;
0314:
0315:            /**
0316:             * Can moderate the forum, such as lock thread or approve pending threads.
0317:             * Please note that there is not PERMISSION_MODERATE_POST because
0318:             * who can moderate threads obviously can moderate posts too.
0319:             */
0320:            public static final int PERMISSION_MODERATE_THREAD = 2110;
0321:
0322:            /**
0323:             * Can edit user own posts
0324:             */
0325:            public static final int PERMISSION_EDIT_OWN_POST = 2111;
0326:
0327:            /**
0328:             * Can edit user own polls
0329:             */
0330:            public static final int PERMISSION_EDIT_OWN_POLL = 2112;
0331:
0332:            /**************************************************************************
0333:             *                  MVN CMS Permission Constants
0334:             * Individual Permissions that can be applied for individual Channel usages,
0335:             * (of course it can be applied to all channels), range from 10,000 to (20,000-1)
0336:             **************************************************************************/
0337:            /**************************************************************************
0338:             * Individual Permissions which high-level permission, range from 10,000 to (10,099)
0339:             * Usually CMS Admin has these permissions
0340:             **************************************************************************/
0341:
0342:            /**
0343:             * @todo add the description here
0344:             */
0345:            public static final int PERMISSION_CMS_ADD_CHANNEL = 10000;
0346:
0347:            /**
0348:             *
0349:             */
0350:            public static final int PERMISSION_CMS_EDIT_CHANNEL = 10001;
0351:
0352:            /**
0353:             *
0354:             */
0355:            public static final int PERMISSION_CMS_DELETE_CHANNEL = 10002;
0356:
0357:            /**
0358:             * Permission to be an editor
0359:             */
0360:            public static final int PERMISSION_CMS_HAVE_ROLE_EDITOR = 10003;
0361:
0362:            /**
0363:             * Permission to be an chief editor
0364:             */
0365:            public static final int PERMISSION_CMS_HAVE_ROLE_CHIEF_EDITOR = 10004;
0366:
0367:            /**
0368:             * This permission allow user to manage the Gold Price, Weather Information, etc
0369:             */
0370:            public static final int PERMISSION_CMS_MANAGE_INFO_IN_DAY = 10005;
0371:
0372:            /**
0373:             * This permission will have full permissions on on CMS System
0374:             */
0375:            public static final int PERMISSION_CMS_MANAGE_CMS_SYSTEM = 10006;
0376:
0377:            /**
0378:             * This permission allow editing the layout of the Content Display System
0379:             */
0380:            public static final int PERMISSION_CMS_EDIT_CDS_LAYOUT = 10007;
0381:
0382:            /**************************************************************************
0383:             * Individual Permissions which low-level permission, range from (10,100 to 10,999)
0384:             **************************************************************************/
0385:            /**
0386:             *
0387:             */
0388:            public static final int PERMISSION_CMS_WRITE_CONTENT = 10100;
0389:
0390:            /**
0391:             *
0392:             */
0393:            public static final int PERMISSION_CMS_EDIT_CONTENT = 10101;
0394:
0395:            /**
0396:             *
0397:             */
0398:            public static final int PERMISSION_CMS_APPROVE_CONTENT = 10102;
0399:
0400:            /**
0401:             *
0402:             */
0403:            public static final int PERMISSION_CMS_PUBLISH_CONTENT = 10103;
0404:
0405:            /**
0406:             *
0407:             */
0408:            public static final int PERMISSION_CMS_DELETE_CONTENT = 10104;
0409:
0410:            /**
0411:             *
0412:             */
0413:            public static final int PERMISSION_CMS_UPLOAD_FILE = 10105;
0414:
0415:            //---------------------------------------------------------------------
0416:            /**
0417:             *
0418:             */
0419:            public static final int PERMISSION_CMS_VIEW_CONTENT = 10106;
0420:
0421:            /**
0422:             *
0423:             */
0424:            public static final int PERMISSION_CMS_DEPLOY_CONTENT = 10107;
0425:
0426:            /**
0427:             *
0428:             */
0429:            public static final int PERMISSION_CMS_VIEW_STEP = 10108;
0430:
0431:            /**
0432:             *
0433:             */
0434:            public static final int PERMISSION_CMS_GOTO_STEP = 10109;
0435:
0436:            /**************************************************************************
0437:             *                  MVN Ads Permission Constants
0438:             * Individual Permissions that can be applied for individual Channel usages,
0439:             * (of course it can be applied to all channels), range from 20,000 to (30,000-1)
0440:             **************************************************************************/
0441:            /**************************************************************************
0442:             * Individual Permissions which high-level permission, range from 20,000 to (20,099)
0443:             * Usually Ads Admin has these permissions
0444:             **************************************************************************/
0445:
0446:            /**
0447:             * This permission will have full permissions on on Ads System
0448:             */
0449:            public static final int PERMISSION_ADS_MANAGE_ADS = 20000;
0450:
0451:            /**
0452:             * Can add a new zone
0453:             */
0454:            public static final int PERMISSION_ADS_ADD_ZONE = 20001;
0455:
0456:            /**
0457:             * Can edit a zone
0458:             */
0459:            public static final int PERMISSION_ADS_EDIT_ZONE = 20002;
0460:
0461:            /**
0462:             * Can delete a zone
0463:             */
0464:            public static final int PERMISSION_ADS_DELETE_ZONE = 20003;
0465:
0466:            /**
0467:             * Can add a new banner
0468:             */
0469:            public static final int PERMISSION_ADS_ADD_BANNER = 20004;
0470:
0471:            /**
0472:             * Can edit a banner
0473:             */
0474:            public static final int PERMISSION_ADS_EDIT_BANNER = 20005;
0475:
0476:            /**
0477:             * Can delete a banner
0478:             */
0479:            public static final int PERMISSION_ADS_DELETE_BANNER = 20006;
0480:
0481:            /**
0482:             * Can view zone
0483:             */
0484:            public static final int PERMISSION_ADS_VIEW_ZONE = 20007;
0485:
0486:            /**
0487:             * Can view banner
0488:             */
0489:            public static final int PERMISSION_ADS_VIEW_BANNER = 20008;
0490:
0491:            /**
0492:             * Can upload media
0493:             */
0494:            public static final int PERMISSION_ADS_UPLOAD_MEDIA = 20009;
0495:
0496:            /**************************************************************************
0497:             * Define array of permissions 
0498:             **************************************************************************/
0499:            public static final int[] globalCombinedPermissionArray = {
0500:                    PERMISSION_SYSTEM_ADMIN,
0501:
0502:                    // below are forum-applicable permissions
0503:                    PERMISSION_FORUM_ADMIN, PERMISSION_FORUM_MODERATOR,
0504:                    PERMISSION_POWER_USER, PERMISSION_NORMAL_USER,
0505:                    PERMISSION_LIMITED_USER };
0506:
0507:            public static final int[] forumCombinedPermissionArray = {
0508:                    PERMISSION_FORUM_ADMIN, PERMISSION_FORUM_MODERATOR,
0509:                    PERMISSION_POWER_USER, PERMISSION_NORMAL_USER,
0510:                    PERMISSION_LIMITED_USER };
0511:
0512:            public static final int[] globalIndividualPermissionArray = {
0513:                    //PERMISSION_LOGIN,//minhnn: login is not used, so I removed it to avoid confusion
0514:                    //PERMISSION_ADMIN_SYSTEM,
0515:                    PERMISSION_ADD_CATEGORY,
0516:                    PERMISSION_EDIT_CATEGORY,
0517:                    PERMISSION_DELETE_CATEGORY,
0518:                    PERMISSION_ADD_FORUM,
0519:
0520:                    // these 2 permission should be in forum-applicable permissions,
0521:                    // However, I put it here for the more natural order that user
0522:                    // can see in interface
0523:                    PERMISSION_EDIT_FORUM,
0524:                    PERMISSION_DELETE_FORUM,
0525:                    PERMISSION_ASSIGN_TO_FORUM,
0526:                    PERMISSION_BYPASS_PRIVATE_FORUM,
0527:
0528:                    // forum-non-applicable permissions
0529:                    PERMISSION_SEND_MAIL,
0530:                    PERMISSION_MODERATE_USER,
0531:                    PERMISSION_USE_MESSAGE,
0532:                    PERMISSION_ADD_MESSAGE_ATTACHMENT,
0533:                    PERMISSION_USE_AVATAR,
0534:                    PERMISSION_USE_ALBUM,
0535:                    PERMISSION_MANAGE_ORPHAN_POLL,
0536:                    PERMISSION_MANAGE_ALBUMITEM_POLL,
0537:                    PERMISSION_SET_POLL_TO_ANONYMOUS_TYPE,
0538:
0539:                    // below are forum-applicable permissions
0540:                    PERMISSION_MODERATE_THREAD, PERMISSION_READ_POST,
0541:                    PERMISSION_ADD_THREAD, PERMISSION_ADD_POST,
0542:                    PERMISSION_EDIT_POST, PERMISSION_EDIT_OWN_POST,
0543:                    PERMISSION_DELETE_POST, PERMISSION_ADD_POLL,
0544:                    PERMISSION_EDIT_POLL, PERMISSION_EDIT_OWN_POLL,
0545:                    PERMISSION_DELETE_POLL, PERMISSION_ADD_ATTACHMENT,
0546:                    PERMISSION_GET_ATTACHMENT };
0547:
0548:            public static final int[] forumIndividualPermissionArray = {
0549:                    PERMISSION_EDIT_FORUM, PERMISSION_DELETE_FORUM,
0550:                    PERMISSION_ASSIGN_TO_FORUM, PERMISSION_MODERATE_THREAD,
0551:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0552:                    PERMISSION_ADD_POST, PERMISSION_EDIT_POST,
0553:                    PERMISSION_EDIT_OWN_POST, PERMISSION_DELETE_POST,
0554:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_POLL,
0555:                    PERMISSION_EDIT_OWN_POLL, PERMISSION_DELETE_POLL,
0556:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0557:
0558:            public static final int[] globalCMSIndividualPermissionArray = {
0559:                    PERMISSION_CMS_ADD_CHANNEL, PERMISSION_CMS_EDIT_CHANNEL,
0560:                    PERMISSION_CMS_DELETE_CHANNEL,
0561:
0562:                    PERMISSION_CMS_HAVE_ROLE_EDITOR,
0563:                    PERMISSION_CMS_HAVE_ROLE_CHIEF_EDITOR,
0564:
0565:                    PERMISSION_CMS_MANAGE_INFO_IN_DAY,
0566:                    PERMISSION_CMS_EDIT_CDS_LAYOUT,
0567:
0568:                    PERMISSION_CMS_DELETE_CONTENT,
0569:                    PERMISSION_CMS_PUBLISH_CONTENT,
0570:                    PERMISSION_CMS_APPROVE_CONTENT,
0571:                    PERMISSION_CMS_EDIT_CONTENT, PERMISSION_CMS_WRITE_CONTENT,
0572:                    //---------------------------------------------------------------------
0573:                    PERMISSION_CMS_VIEW_CONTENT, PERMISSION_CMS_DEPLOY_CONTENT,
0574:                    PERMISSION_CMS_VIEW_STEP, PERMISSION_CMS_GOTO_STEP };
0575:
0576:            public static final int[] globalAdsIndividualPermissionArray = {
0577:                    PERMISSION_ADS_MANAGE_ADS, PERMISSION_ADS_VIEW_ZONE,
0578:                    PERMISSION_ADS_ADD_ZONE, PERMISSION_ADS_EDIT_ZONE,
0579:                    PERMISSION_ADS_DELETE_ZONE, PERMISSION_ADS_VIEW_BANNER,
0580:                    PERMISSION_ADS_ADD_BANNER, PERMISSION_ADS_EDIT_BANNER,
0581:                    PERMISSION_ADS_DELETE_BANNER, PERMISSION_ADS_UPLOAD_MEDIA };
0582:
0583:            /**************************************************************************
0584:             * Define array of permissions for combined permissions
0585:             * Please note that each combined permission have 2 arrays, one
0586:             * for global permissions and one for forum-specific permissions
0587:             **************************************************************************/
0588:            public static int[] individualForumAdminPermissionArray = {
0589:                    PERMISSION_ADD_CATEGORY, PERMISSION_EDIT_CATEGORY,
0590:                    PERMISSION_DELETE_CATEGORY, PERMISSION_ADD_FORUM,
0591:
0592:                    PERMISSION_EDIT_FORUM, PERMISSION_DELETE_FORUM,
0593:                    PERMISSION_ASSIGN_TO_FORUM, PERMISSION_MODERATE_THREAD,
0594:
0595:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0596:                    PERMISSION_ADD_POST, PERMISSION_EDIT_POST,
0597:                    PERMISSION_EDIT_OWN_POST, PERMISSION_DELETE_POST,
0598:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_POLL,
0599:                    PERMISSION_EDIT_OWN_POLL, PERMISSION_DELETE_POLL,
0600:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0601:
0602:            public static int[] individualForumAdminLimitPermissionArray = {
0603:                    PERMISSION_EDIT_FORUM, PERMISSION_DELETE_FORUM,
0604:                    PERMISSION_ASSIGN_TO_FORUM, PERMISSION_MODERATE_THREAD,
0605:
0606:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0607:                    PERMISSION_ADD_POST, PERMISSION_EDIT_POST,
0608:                    PERMISSION_EDIT_OWN_POST, PERMISSION_DELETE_POST,
0609:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_POLL,
0610:                    PERMISSION_EDIT_OWN_POLL, PERMISSION_DELETE_POLL,
0611:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0612:
0613:            public static int[] individualForumModeratorPermissionArray = {
0614:                    PERMISSION_EDIT_CATEGORY,
0615:
0616:                    PERMISSION_EDIT_FORUM, PERMISSION_MODERATE_THREAD,
0617:
0618:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0619:                    PERMISSION_ADD_POST, PERMISSION_EDIT_POST,
0620:                    PERMISSION_EDIT_OWN_POST, PERMISSION_DELETE_POST,
0621:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_POLL,
0622:                    PERMISSION_EDIT_OWN_POLL, PERMISSION_DELETE_POLL,
0623:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0624:
0625:            public static int[] individualForumModeratorLimitPermissionArray = {
0626:                    PERMISSION_EDIT_FORUM, PERMISSION_MODERATE_THREAD,
0627:
0628:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0629:                    PERMISSION_ADD_POST, PERMISSION_EDIT_POST,
0630:                    PERMISSION_EDIT_OWN_POST, PERMISSION_DELETE_POST,
0631:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_POLL,
0632:                    PERMISSION_EDIT_OWN_POLL, PERMISSION_DELETE_POLL,
0633:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0634:
0635:            public static int[] individualPowerUserPermissionArray = {
0636:                    PERMISSION_USE_MESSAGE, PERMISSION_ADD_MESSAGE_ATTACHMENT,
0637:                    PERMISSION_USE_AVATAR, PERMISSION_USE_ALBUM,
0638:
0639:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0640:                    PERMISSION_ADD_POST, PERMISSION_EDIT_OWN_POST,
0641:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_OWN_POLL,
0642:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0643:
0644:            public static int[] individualPowerUserLimitPermissionArray = {
0645:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0646:                    PERMISSION_ADD_POST, PERMISSION_EDIT_OWN_POST,
0647:                    PERMISSION_ADD_POLL, PERMISSION_EDIT_OWN_POLL,
0648:                    PERMISSION_ADD_ATTACHMENT, PERMISSION_GET_ATTACHMENT };
0649:
0650:            public static int[] individualNormalUserPermissionArray = {
0651:                    PERMISSION_USE_MESSAGE, PERMISSION_USE_AVATAR,
0652:
0653:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0654:                    PERMISSION_ADD_POST, PERMISSION_GET_ATTACHMENT };
0655:
0656:            public static int[] individualNormalUserLimitPermissionArray = {
0657:                    PERMISSION_READ_POST, PERMISSION_ADD_THREAD,
0658:                    PERMISSION_ADD_POST, PERMISSION_GET_ATTACHMENT };
0659:
0660:            public static int[] individualLimitedUserPermissionArray = { PERMISSION_READ_POST };
0661:
0662:            public static int[] individualLimitedUserLimitPermissionArray = { PERMISSION_READ_POST };
0663:
0664:            /**************************************************************************
0665:             * Special permissions methods
0666:             **************************************************************************/
0667:
0668:            public boolean isAuthenticated();
0669:
0670:            public void ensureIsAuthenticated() throws AuthenticationException;
0671:
0672:            public boolean isActivated();
0673:
0674:            public void ensureIsActivated() throws AuthenticationException;
0675:
0676:            /**************************************************************************
0677:             * The below methods are used to check global permissions
0678:             **************************************************************************/
0679:
0680:            public boolean canLogin();
0681:
0682:            public void ensureCanLogin() throws AuthenticationException;
0683:
0684:            public boolean canAdminSystem();
0685:
0686:            public void ensureCanAdminSystem() throws AuthenticationException;
0687:
0688:            public boolean canAddForum();
0689:
0690:            public void ensureCanAddForum() throws AuthenticationException;
0691:
0692:            public boolean canAddCategory();
0693:
0694:            public void ensureCanAddCategory() throws AuthenticationException;
0695:
0696:            public boolean canEditCategory();
0697:
0698:            public void ensureCanEditCategory() throws AuthenticationException;
0699:
0700:            public boolean canDeleteCategory();
0701:
0702:            public void ensureCanDeleteCategory()
0703:                    throws AuthenticationException;
0704:
0705:            public boolean canSendMail();
0706:
0707:            public void ensureCanSendMail() throws AuthenticationException;
0708:
0709:            public boolean canModerateUser();
0710:
0711:            public void ensureCanModerateUser() throws AuthenticationException;
0712:
0713:            public boolean canUseAvatar();
0714:
0715:            public void ensureCanUseAvatar() throws AuthenticationException;
0716:
0717:            public boolean canUseMessage();
0718:
0719:            public void ensureCanUseMessage() throws AuthenticationException;
0720:
0721:            public boolean canAddMessageAttachment();
0722:
0723:            public void ensureCanAddMessageAttachment()
0724:                    throws AuthenticationException;
0725:
0726:            public boolean canUseAlbum();
0727:
0728:            public void ensureCanUseAlbum() throws AuthenticationException;
0729:
0730:            public boolean canManageOrphanPoll();
0731:
0732:            public void ensureCanManageOrphanPoll()
0733:                    throws AuthenticationException;
0734:
0735:            public boolean canManageAlbumItemPoll();
0736:
0737:            public void ensureCanManageAlbumItemPoll()
0738:                    throws AuthenticationException;
0739:
0740:            public boolean canSetPollToAnonymousType();
0741:
0742:            public void ensureCanSetPollToAnonymousType()
0743:                    throws AuthenticationException;
0744:
0745:            /**************************************************************************
0746:             * The below methods are used to check individual forum permissions
0747:             **************************************************************************/
0748:
0749:            public boolean canEditForum(int forumID);
0750:
0751:            public void ensureCanEditForum(int forumID)
0752:                    throws AuthenticationException;
0753:
0754:            public boolean canDeleteForum(int forumID);
0755:
0756:            public void ensureCanDeleteForum(int forumID)
0757:                    throws AuthenticationException;
0758:
0759:            public boolean canAssignToForum(int forumID);
0760:
0761:            public void ensureCanAssignToForum(int forumID)
0762:                    throws AuthenticationException;
0763:
0764:            public boolean canReadPost(int forumID);
0765:
0766:            public void ensureCanReadPost(int forumID)
0767:                    throws AuthenticationException;
0768:
0769:            public boolean canAddThread(int forumID);
0770:
0771:            public void ensureCanAddThread(int forumID)
0772:                    throws AuthenticationException;
0773:
0774:            public boolean canAddPost(int forumID);
0775:
0776:            public void ensureCanAddPost(int forumID)
0777:                    throws AuthenticationException;
0778:
0779:            public boolean canEditPost(int forumID);
0780:
0781:            public void ensureCanEditPost(int forumID)
0782:                    throws AuthenticationException;
0783:
0784:            public boolean canEditOwnPost(int forumID);
0785:
0786:            public void ensureCanEditOwnPost(int forumID)
0787:                    throws AuthenticationException;
0788:
0789:            public boolean canDeletePost(int forumID);
0790:
0791:            public void ensureCanDeletePost(int forumID)
0792:                    throws AuthenticationException;
0793:
0794:            public boolean canAddPoll(int forumID);
0795:
0796:            public void ensureCanAddPoll(int forumID)
0797:                    throws AuthenticationException;
0798:
0799:            public boolean canAddPoll();
0800:
0801:            public void ensureCanAddPoll() throws AuthenticationException;
0802:
0803:            public boolean canEditPoll(int forumID);
0804:
0805:            public void ensureCanEditPoll(int forumID)
0806:                    throws AuthenticationException;
0807:
0808:            public boolean canEditPoll();
0809:
0810:            public void ensureCanEditPoll() throws AuthenticationException;
0811:
0812:            public boolean canEditOwnPoll(int forumID);
0813:
0814:            public void ensureCanEditOwnPoll(int forumID)
0815:                    throws AuthenticationException;
0816:
0817:            public boolean canDeletePoll(int forumID);
0818:
0819:            public void ensureCanDeletePoll(int forumID)
0820:                    throws AuthenticationException;
0821:
0822:            public boolean canDeletePoll();
0823:
0824:            public void ensureCanDeletePoll() throws AuthenticationException;
0825:
0826:            public boolean canAddAttachment(int forumID);
0827:
0828:            public void ensureCanAddAttachment(int forumID)
0829:                    throws AuthenticationException;
0830:
0831:            public boolean canGetAttachment(int forumID);
0832:
0833:            public void ensureCanGetAttachment(int forumID)
0834:                    throws AuthenticationException;
0835:
0836:            public boolean canModerateThread(int forumID);
0837:
0838:            public void ensureCanModerateThread(int forumID)
0839:                    throws AuthenticationException;
0840:
0841:            /**************************************************************************
0842:             * The below methods are used to check global CHANNEL permissions
0843:             **************************************************************************/
0844:
0845:            public boolean canAddChannel();
0846:
0847:            public void ensureCanAddChannel() throws AuthenticationException;
0848:
0849:            public boolean canEditChannel();
0850:
0851:            public void ensureCanEditChannel() throws AuthenticationException;
0852:
0853:            public boolean canDeleteChannel();
0854:
0855:            public void ensureCanDeleteChannel() throws AuthenticationException;
0856:
0857:            public boolean canHaveRoleEditor();
0858:
0859:            public void ensureCanHaveRoleEditor()
0860:                    throws AuthenticationException;
0861:
0862:            public boolean canHaveRoleChiefEditor();
0863:
0864:            public void ensureCanHaveRoleChiefEditor()
0865:                    throws AuthenticationException;
0866:
0867:            public boolean canManageInfoInDay();
0868:
0869:            public void ensureCanManageInfoInDay()
0870:                    throws AuthenticationException;
0871:
0872:            public boolean canEditCDSLayout();
0873:
0874:            public void ensureCanEditCDSLayout() throws AuthenticationException;
0875:
0876:            /**************************************************************************
0877:             * The below methods are used to check individual STEP And CHANNEL permissions
0878:             **************************************************************************/
0879:            //---------------------------------------------------------------------
0880:            public boolean isMemberInGroup(String groupName);
0881:
0882:            public void ensureIsMemberInGroup(String groupName)
0883:                    throws AuthenticationException;
0884:
0885:            public boolean canWriteContent(int channelID);
0886:
0887:            public void ensureCanWriteContent(int channelID)
0888:                    throws AuthenticationException;
0889:
0890:            public boolean canWriteContentInStepWithChannel(int stepID,
0891:                    int channelID);
0892:
0893:            public void ensureCanWriteContentInStepWithChannel(int stepID,
0894:                    int channelID) throws AuthenticationException;
0895:
0896:            public boolean canEditContent(int channelID);
0897:
0898:            public void ensureCanEditContent(int channelID)
0899:                    throws AuthenticationException;
0900:
0901:            //---------------------------------------------------------------------
0902:            public boolean canEditContentInStepWithChannel(int stepID,
0903:                    int channelID);
0904:
0905:            public void ensureCanEditContentInStepWithChannel(int stepID,
0906:                    int channelID) throws AuthenticationException;
0907:
0908:            public boolean canApproveContent(int channelID);
0909:
0910:            public void ensureCanApproveContent(int channelID)
0911:                    throws AuthenticationException;
0912:
0913:            public boolean canPublishContent(int channelID);
0914:
0915:            public void ensureCanPublishContent(int channelID)
0916:                    throws AuthenticationException;
0917:
0918:            public boolean canDeleteContent(int channelID);
0919:
0920:            public void ensureCanDeleteContent(int channelID)
0921:                    throws AuthenticationException;
0922:
0923:            //---------------------------------------------------------------------
0924:            public boolean canDeleteContentInStepWithChannel(int stepID,
0925:                    int channelID);
0926:
0927:            public void ensureCanDeleteContentInStepWithChannel(int stepID,
0928:                    int channelID) throws AuthenticationException;
0929:
0930:            public boolean canViewContentInStepWithChannel(int stepID,
0931:                    int channelID);
0932:
0933:            public void ensureCanViewContentInStepWithChannel(int stepID,
0934:                    int channelID) throws AuthenticationException;
0935:
0936:            public boolean canViewContentStepWithChannel(int stepID,
0937:                    int channelID);
0938:
0939:            public void ensureCanViewContentStepWithChannel(int stepID,
0940:                    int channelID) throws AuthenticationException;
0941:
0942:            public boolean canGoToContentStepWithChannel(int stepID,
0943:                    int channelID);
0944:
0945:            public void ensureCanGoToContentStepWithChannel(int stepID,
0946:                    int channelID) throws AuthenticationException;
0947:
0948:            public boolean canViewContentStepWithAnyChannel(int stepID);
0949:
0950:            public void ensureCanViewContentStepWithAnyChannel(int stepID)
0951:                    throws AuthenticationException;
0952:
0953:            public boolean canDeployContentInStepWithChannel(int stepID,
0954:                    int channelID);
0955:
0956:            public void ensureCanDeployContentInStepWithChannel(int stepID,
0957:                    int channelID) throws AuthenticationException;
0958:
0959:            /**************************************************************************
0960:             * The below methods are utility methods to support checking FORUM permission
0961:             **************************************************************************/
0962:
0963:            public boolean canEditAnyForum();
0964:
0965:            public void ensureCanEditAnyForum() throws AuthenticationException;
0966:
0967:            public boolean canModerateThreadInAnyForum();
0968:
0969:            public void ensureCanModerateThreadInAnyForum()
0970:                    throws AuthenticationException;
0971:
0972:            public boolean canGetAttachmentInAnyForum();
0973:
0974:            public void ensureCanGetAttachmentInAnyForum()
0975:                    throws AuthenticationException;
0976:
0977:            /**************************************************************************
0978:             * The below methods are utility methods to support checking CHANNEL permission
0979:             **************************************************************************/
0980:            public boolean canWriteContentInAnyChannel();
0981:
0982:            public void ensureCanWriteContentInAnyChannel()
0983:                    throws AuthenticationException;
0984:
0985:            public boolean canWriteContentInAnyChannelWithAnyStep();
0986:
0987:            public void ensureCanWriteContentInAnyChannelWithAnyStep()
0988:                    throws AuthenticationException;
0989:
0990:            public boolean canEditContentInAnyChannel();
0991:
0992:            public void ensureCanEditContentInAnyChannel()
0993:                    throws AuthenticationException;
0994:
0995:            public boolean canApproveContentInAnyChannel();
0996:
0997:            public void ensureCanApproveContentInAnyChannel()
0998:                    throws AuthenticationException;
0999:
1000:            public boolean canPublishContentInAnyChannel();
1001:
1002:            public void ensureCanPublishContentInAnyChannel()
1003:                    throws AuthenticationException;
1004:
1005:            public boolean canDeployContentWithStepInAnyChannel(int stepID);
1006:
1007:            public void ensureCanDeployContentWithStepInAnyChannel(int stepID)
1008:                    throws AuthenticationException;
1009:
1010:            /**
1011:             * Check if user can access workflow or not.
1012:             */
1013:            public boolean canViewAnyContentStep();
1014:
1015:            public void ensureCanViewAnyContentStep()
1016:                    throws AuthenticationException;
1017:
1018:            /**************************************************************************
1019:             * The below methods are used to check global Ads permissions
1020:             **************************************************************************/
1021:
1022:            public boolean canManageAds();
1023:
1024:            public void ensureCanManageAds() throws AuthenticationException;
1025:
1026:            public boolean canAddZone();
1027:
1028:            public void ensureCanAddZone() throws AuthenticationException;
1029:
1030:            public boolean canEditZone();
1031:
1032:            public void ensureCanEditZone() throws AuthenticationException;
1033:
1034:            public boolean canDeleteZone();
1035:
1036:            public void ensureCanDeleteZone() throws AuthenticationException;
1037:
1038:            public boolean canAddBanner();
1039:
1040:            public void ensureCanAddBanner() throws AuthenticationException;
1041:
1042:            public boolean canEditBanner();
1043:
1044:            public void ensureCanEditBanner() throws AuthenticationException;
1045:
1046:            public boolean canDeleteBanner();
1047:
1048:            public void ensureCanDeleteBanner() throws AuthenticationException;
1049:
1050:            public boolean canViewZone();
1051:
1052:            public void ensureCanViewZone() throws AuthenticationException;
1053:
1054:            public boolean canViewBanner();
1055:
1056:            public void ensureCanViewBanner() throws AuthenticationException;
1057:
1058:            public boolean canUploadMedia();
1059:
1060:            public void ensureCanUploadMedia() throws AuthenticationException;
1061:
1062:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.