You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2016/11/21 15:21:42 UTC

svn commit: r1770698 - in /turbine/core/trunk/src/java/org/apache/turbine/annotation: TurbineRequiredPermission.java TurbineRequiredRole.java

Author: tv
Date: Mon Nov 21 15:21:42 2016
New Revision: 1770698

URL: http://svn.apache.org/viewvc?rev=1770698&view=rev
Log:
First proposal for declarative security

Added:
    turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java   (with props)
    turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java   (with props)

Added: turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java?rev=1770698&view=auto
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java (added)
+++ turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java Mon Nov 21 15:21:42 2016
@@ -0,0 +1,47 @@
+package org.apache.turbine.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/*
+ * 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.
+ */
+
+/**
+ * Annotation to mark modules or methods in modules that require certain permissions to be executed
+ */
+@Retention( RetentionPolicy.RUNTIME )
+@Target( { ElementType.TYPE, ElementType.METHOD } )
+public @interface TurbineRequiredPermission
+{
+    /**
+     * Get the names of the permissions required to use this class or method
+     *
+     * @return an array of permission names
+     */
+    String[] value();
+
+    /**
+     * Get the name of the permission-associated group
+     * 
+     * @return a group name, empty string if the global group
+     */
+    String group() default "";
+}

Propchange: turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredPermission.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java?rev=1770698&view=auto
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java (added)
+++ turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java Mon Nov 21 15:21:42 2016
@@ -0,0 +1,47 @@
+package org.apache.turbine.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/*
+ * 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.
+ */
+
+/**
+ * Annotation to mark modules or methods in modules that require certain roles to be executed
+ */
+@Retention( RetentionPolicy.RUNTIME )
+@Target( { ElementType.TYPE, ElementType.METHOD } )
+public @interface TurbineRequiredRole
+{
+    /**
+     * Get the names of the roles required to use this class or method
+     *
+     * @return an array of role names
+     */
+    String[] value();
+    
+    /**
+     * Get the name of the role-associated group
+     * 
+     * @return a group name, empty string if the global group
+     */
+    String group() default "";
+}

Propchange: turbine/core/trunk/src/java/org/apache/turbine/annotation/TurbineRequiredRole.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain