Java Doc for PagePermission.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » auth » permissions » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.auth.permissions 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.security.Permission
      com.ecyrd.jspwiki.auth.permissions.PagePermission

PagePermission
final public class PagePermission extends Permission (Code)

Permission to perform an operation on a single page or collection of pages in a given wiki. Permission actions include: viewedit (edit the text of a wiki page), commentuploadmodify (edit text and upload attachments), delete  and rename.

The target of a permission is a single page or collection in a given wiki. The syntax for the target is the wiki name, followed by a colon (:) and the name of the page. "All wikis" can be specified using a wildcard (*). Page collections may also be specified using a wildcard. For pages, the wildcard may be a prefix, suffix, or all by itself. Examples of targets include:

*:*
:JanneJalkanen
:Jalkanen
:Janne*
mywiki:JanneJalkanen
mywiki:*Jalkanen
mywiki:Janne*

For a given target, certain permissions imply others:

  • delete and rename imply edit
  • modify implies edit and upload
  • edit implies comment and view
  • comment and upload imply view
  • Targets that do not include a wiki prefix never imply others.

author:
   Andrew Jaquith
since:
   2.3


Field Summary
final public static  PagePermissionCOMMENT
    
final public static  StringCOMMENT_ACTION
    
final protected static  intCOMMENT_MASK
    
final public static  PagePermissionDELETE
    
final public static  StringDELETE_ACTION
    
final protected static  intDELETE_MASK
    
final public static  PagePermissionEDIT
    
final public static  StringEDIT_ACTION
    
final protected static  intEDIT_MASK
    
final public static  PagePermissionMODIFY
    
final public static  StringMODIFY_ACTION
    
final protected static  intMODIFY_MASK
    
final public static  PagePermissionRENAME
    
final public static  StringRENAME_ACTION
    
final protected static  intRENAME_MASK
    
final public static  PagePermissionUPLOAD
    
final public static  StringUPLOAD_ACTION
    
final protected static  intUPLOAD_MASK
    
final public static  PagePermissionVIEW
    
final public static  StringVIEW_ACTION
    
final protected static  intVIEW_MASK
    

Constructor Summary
public  PagePermission(String page, String actions)
     Creates a new PagePermission for a specified page name and set of actions.
public  PagePermission(WikiPage page, String actions)
     Creates a new PagePermission for a specified page and set of actions.

Method Summary
final protected static  intcreateMask(String actions)
     Private method that creates a binary mask based on the actions specified.
final public  booleanequals(Object obj)
     Two PagePermission objects are considered equal if their actions (after normalization), wiki and target are equal.
final public  StringgetActions()
     Returns the actions for this permission: "view", "edit", "comment", "modify", "upload" or "delete".
final public  StringgetPage()
     Returns the name of the wiki page represented by this permission.
final public  StringgetWiki()
     Returns the name of the wiki containing the page represented by this permission; may return the wildcard string.
final public  inthashCode()
     Returns the hash code for this PagePermission.
final protected static  intimpliedMask(int mask)
     Creates an "implied mask" based on the actions originally assigned: for example, delete implies modify, comment, upload and view.
final public  booleanimplies(Permission permission)
    

PagePermission can only imply other PagePermissions; no other permission types are implied.

final protected static  booleanisSubset(String superSet, String subSet)
     Determines whether one target string is a logical subset of the other.
public  PermissionCollectionnewPermissionCollection()
     Returns a new AllPermissionCollection .
final public  StringtoString()
     Prints a human-readable representation of this permission.

Field Detail
COMMENT
final public static PagePermission COMMENT(Code)



COMMENT_ACTION
final public static String COMMENT_ACTION(Code)



COMMENT_MASK
final protected static int COMMENT_MASK(Code)



DELETE
final public static PagePermission DELETE(Code)



DELETE_ACTION
final public static String DELETE_ACTION(Code)



DELETE_MASK
final protected static int DELETE_MASK(Code)



EDIT
final public static PagePermission EDIT(Code)



EDIT_ACTION
final public static String EDIT_ACTION(Code)



EDIT_MASK
final protected static int EDIT_MASK(Code)



MODIFY
final public static PagePermission MODIFY(Code)



MODIFY_ACTION
final public static String MODIFY_ACTION(Code)



MODIFY_MASK
final protected static int MODIFY_MASK(Code)



RENAME
final public static PagePermission RENAME(Code)



RENAME_ACTION
final public static String RENAME_ACTION(Code)



RENAME_MASK
final protected static int RENAME_MASK(Code)



UPLOAD
final public static PagePermission UPLOAD(Code)



UPLOAD_ACTION
final public static String UPLOAD_ACTION(Code)



UPLOAD_MASK
final protected static int UPLOAD_MASK(Code)



VIEW
final public static PagePermission VIEW(Code)



VIEW_ACTION
final public static String VIEW_ACTION(Code)



VIEW_MASK
final protected static int VIEW_MASK(Code)




Constructor Detail
PagePermission
public PagePermission(String page, String actions)(Code)
Creates a new PagePermission for a specified page name and set of actions. Page should include a prepended wiki name followed by a colon (:). If the wiki name is not supplied or starts with a colon, the page refers to no wiki in particular, and will never imply any other PagePermission.
Parameters:
  page - the wiki page
Parameters:
  actions - the allowed actions for this page



PagePermission
public PagePermission(WikiPage page, String actions)(Code)
Creates a new PagePermission for a specified page and set of actions.
Parameters:
  page - The wikipage.
Parameters:
  actions - A set of actions; a comma-separated list of actions.




Method Detail
createMask
final protected static int createMask(String actions)(Code)
Private method that creates a binary mask based on the actions specified. This is used by PagePermission.implies(Permission) .
Parameters:
  actions - the actions for this permission, separated by commas the binary actions mask



equals
final public boolean equals(Object obj)(Code)
Two PagePermission objects are considered equal if their actions (after normalization), wiki and target are equal.
See Also:   java.lang.Object.equals(java.lang.Object)



getActions
final public String getActions()(Code)
Returns the actions for this permission: "view", "edit", "comment", "modify", "upload" or "delete". The actions will always be sorted in alphabetic order, and will always appear in lower case.
See Also:   java.security.Permission.getActions



getPage
final public String getPage()(Code)
Returns the name of the wiki page represented by this permission. the page name



getWiki
final public String getWiki()(Code)
Returns the name of the wiki containing the page represented by this permission; may return the wildcard string. the wiki



hashCode
final public int hashCode()(Code)
Returns the hash code for this PagePermission.
See Also:   java.lang.Object.hashCode



impliedMask
final protected static int impliedMask(int mask)(Code)
Creates an "implied mask" based on the actions originally assigned: for example, delete implies modify, comment, upload and view.
Parameters:
  mask - binary mask for actions binary mask for implied actions



implies
final public boolean implies(Permission permission)(Code)

PagePermission can only imply other PagePermissions; no other permission types are implied. One PagePermission implies another if its actions if three conditions are met:

  1. The other PagePermission's wiki is equal to, or a subset of, that of this permission. This permission's wiki is considered a superset of the other if it contains a matching prefix plus a wildcard, or a wildcard followed by a matching suffix.
  2. The other PagePermission's target is equal to, or a subset of, the target specified by this permission. This permission's target is considered a superset of the other if it contains a matching prefix plus a wildcard, or a wildcard followed by a matching suffix.
  3. All of other PagePermission's actions are equal to, or a subset of, those of this permission

See Also:   java.security.Permission.implies(java.security.Permission)



isSubset
final protected static boolean isSubset(String superSet, String subSet)(Code)
Determines whether one target string is a logical subset of the other.
Parameters:
  superSet - the prospective superset
Parameters:
  subSet - the prospective subset the results of the test, where true indicates thatsubSet is a subset of superSet



newPermissionCollection
public PermissionCollection newPermissionCollection()(Code)
Returns a new AllPermissionCollection .
See Also:   java.security.Permission.newPermissionCollection



toString
final public String toString()(Code)
Prints a human-readable representation of this permission.
See Also:   java.lang.Object.toString



Methods inherited from java.security.Permission
public void checkGuard(Object object) throws SecurityException(Code)(Java Doc)
abstract public boolean equals(Object obj)(Code)(Java Doc)
abstract public String getActions()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
abstract public int hashCode()(Code)(Java Doc)
abstract public boolean implies(Permission permission)(Code)(Java Doc)
public PermissionCollection newPermissionCollection()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.