Source Code Cross Referenced for NoSecurity.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » authz » impl » 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 » ERP CRM Financial » sakai » org.sakaiproject.authz.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/authz/tags/sakai_2-4-1/authz-impl/impl/src/java/org/sakaiproject/authz/impl/NoSecurity.java $
003:         * $Id: NoSecurity.java 16931 2006-10-10 03:47:29Z ggolden@umich.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007:         * 
008:         * Licensed under the Educational Community License, Version 1.0 (the "License"); 
009:         * you may not use this file except in compliance with the License. 
010:         * You may obtain a copy of the License at
011:         * 
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software 
015:         * distributed under the License is distributed on an "AS IS" BASIS, 
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
017:         * See the License for the specific language governing permissions and 
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.authz.impl;
021:
022:        import java.util.List;
023:        import java.util.Vector;
024:
025:        import org.apache.commons.logging.Log;
026:        import org.apache.commons.logging.LogFactory;
027:        import org.sakaiproject.authz.api.SecurityAdvisor;
028:        import org.sakaiproject.authz.api.SecurityService;
029:        import org.sakaiproject.user.api.User;
030:        import org.sakaiproject.user.api.UserDirectoryService;
031:
032:        /**
033:         * <p>
034:         * NoSecurity is an example implementation of the Sakai SecurityService.
035:         * </p>
036:         */
037:        public abstract class NoSecurity implements  SecurityService {
038:            /** Our logger. */
039:            private static Log M_log = LogFactory.getLog(NoSecurity.class);
040:
041:            /**********************************************************************************************************************************************************************************************************************************************************
042:             * Dependencies
043:             *********************************************************************************************************************************************************************************************************************************************************/
044:
045:            /**
046:             * @return the UserDirectoryService collaborator.
047:             */
048:            protected abstract UserDirectoryService userDirectoryService();
049:
050:            /**********************************************************************************************************************************************************************************************************************************************************
051:             * Init and Destroy
052:             *********************************************************************************************************************************************************************************************************************************************************/
053:
054:            /**
055:             * Final initialization, once all dependencies are set.
056:             */
057:            public void init() {
058:                M_log.info("init()");
059:            }
060:
061:            /**
062:             * Final cleanup.
063:             */
064:            public void destroy() {
065:                M_log.info("destroy()");
066:            }
067:
068:            /**********************************************************************************************************************************************************************************************************************************************************
069:             * SecurityService implementation
070:             *********************************************************************************************************************************************************************************************************************************************************/
071:
072:            /**
073:             * Get the authenticated session user
074:             * 
075:             * @param user
076:             *        If not null, use this user, else use the session one.
077:             * @return the User object authenticated to the current request's session.
078:             */
079:            protected User getUser(User user) {
080:                if (user != null)
081:                    return user;
082:
083:                return userDirectoryService().getCurrentUser();
084:            }
085:
086:            /**
087:             * Is this a super special super (admin) user?
088:             * 
089:             * @return true, if the user is a cut above the rest, false if a mere mortal.
090:             */
091:            public boolean isSuperUser() {
092:                if (M_log.isDebugEnabled())
093:                    M_log.debug("isSuperUser() true user: " + getUserId(null));
094:                return true;
095:            }
096:
097:            /**
098:             * {@inheritDoc}
099:             */
100:            public boolean isSuperUser(String userId) {
101:                if (M_log.isDebugEnabled())
102:                    M_log.debug("isSuperUser(userId) true user: " + userId);
103:                return true;
104:            }
105:
106:            /**
107:             * Can the user in the security context unlock the lock for use with this resource?
108:             * 
109:             * @param lock
110:             *        The lock id string.
111:             * @param resource
112:             *        The resource id string, or null if no resource is involved.
113:             * @return true, if the user can unlock the lock, false otherwise.
114:             */
115:            public boolean unlock(String lock, String resource) {
116:                if (M_log.isDebugEnabled())
117:                    M_log.debug("unlock() true user: " + getUserId(null)
118:                            + " lock: " + lock + " resource: " + resource);
119:                return true;
120:            }
121:
122:            /**
123:             * Can the user in the security context unlock the lock for use with this resource?
124:             * 
125:             * @param lock
126:             *        The lock id string.
127:             * @param resource
128:             *        The resource id string, or null if no resource is involved.
129:             * @return true, if the user can unlock the lock, false otherwise.
130:             */
131:            public boolean unlock(User user, String lock, String resource) {
132:                if (M_log.isDebugEnabled())
133:                    M_log.debug("unlock() true user: " + getUserId(user)
134:                            + " lock: " + lock + " resource: " + resource);
135:                return true;
136:            }
137:
138:            /**
139:             * {@inheritDoc}
140:             */
141:            public boolean unlock(String userId, String lock, String resource) {
142:                if (M_log.isDebugEnabled())
143:                    M_log.debug("unlock() true user: " + userId + " lock: "
144:                            + lock + " resource: " + resource);
145:                return true;
146:            }
147:
148:            /**
149:             * Access the List of Users who can unlock the lock for use with this resource.
150:             * 
151:             * @param lock
152:             *        The lock id string.
153:             * @param reference
154:             *        The resource reference string.
155:             * @return A List (User) of the users can unlock the lock (may be empty).
156:             */
157:            public List unlockUsers(String lock, String reference) {
158:                return new Vector();
159:            }
160:
161:            protected String getUserId(User u) {
162:                User user = getUser(u);
163:                if (user == null)
164:                    return "";
165:                String id = user.getId();
166:                if (id == null)
167:                    return "";
168:                return id;
169:            }
170:
171:            public void pushAdvisor(SecurityAdvisor advisor) {
172:            }
173:
174:            public SecurityAdvisor popAdvisor() {
175:                return null;
176:            }
177:
178:            public boolean hasAdvisors() {
179:                return false;
180:            }
181:
182:            public void clearAdvisors() {
183:            }
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.