You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ca...@apache.org on 2011/10/18 21:39:26 UTC
svn commit: r1185816 -
/incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext
Author: carlucci
Date: Tue Oct 18 19:39:26 2011
New Revision: 1185816
URL: http://svn.apache.org/viewvc?rev=1185816&view=rev
Log:
How-to for implementing model permission security to core Rave model objects
Added:
incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext (with props)
Added: incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext
URL: http://svn.apache.org/viewvc/incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext?rev=1185816&view=auto
==============================================================================
--- incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext (added)
+++ incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext Tue Oct 18 19:39:26 2011
@@ -0,0 +1,45 @@
+Title:
+Notice: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+How to Implement Permission Security for a new Rave Model Object
+----------------------------------------------------------------
+
+*This how-to is targeted to Rave committers/contributors who have created a completely new model object in Rave and want to implement permission security on it.
+For third-party developers that are customizing Rave and are interested in overriding the default ModelPermissionEvaluator for an existing Rave model, see(PLACEHOLDER)*
+
+1) Create a new Default[ModelName]PermissionEvaluator class in org.apache.rave.portal.security.impl under rave-core.
+
+> (a) it should extend the AbstractModelPermissionEvaluator<[ModelName]>
+>
+> (b) view the DefaultPagePermissionEvaluator class in the same package
+> for an example to follow
+>
+> (c) override the getType() and both hasPermission() signatures. Ensure
+> you follow the same trustedDomainObject pattern by looking up the
+> entity from the repository if you are not guaranteed it to be trusted.
+>
+> (d) make sure the class is marked @Component so it is picked up by
+> Spring's component scanner. This will ensure it gets added to the
+> RavePermissionEvaluator class on startup.
+
+2) Annotate the appropriate Service layer interface methods in org.apache.rave.portal.service with the permission security expression language functions. You can use PageService as a good example of using both PreAuthorize and PostAuthorize, and also for situations where you need to use a RaveSecurityContext object to check permissions against an object that is different from the one being returned in the function. Note that the annotations should not contain any security-specific business logic. The business logic should be implemented in the ModelPermissionEvaluator implementations so that it can be overridden by third-parties.
+
+Click [here][1] for more information on the Spring EL-based security functions.
+
+
+ [1]: http://static.springsource.org/spring-security/site/docs/3.0.x/reference/el-access.html
\ No newline at end of file
Propchange: incubator/rave/site/trunk/content/rave/documentation/new-model-permission-impl.mdtext
------------------------------------------------------------------------------
svn:eol-style = native