You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2017/06/21 22:31:13 UTC
directory-fortress-core git commit: add license
Repository: directory-fortress-core
Updated Branches:
refs/heads/master 75a807623 -> c2963f799
add license
Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/c2963f79
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/c2963f79
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/c2963f79
Branch: refs/heads/master
Commit: c2963f79954008a765200a32a2062663ea46434e
Parents: 75a8076
Author: Shawn McKinney <sm...@apache.org>
Authored: Wed Jun 21 17:31:08 2017 -0500
Committer: Shawn McKinney <sm...@apache.org>
Committed: Wed Jun 21 17:31:08 2017 -0500
----------------------------------------------------------------------
.../README.md | 18 ++++++
.../README.md | 18 ++++++
.../annotation/AdminPermissionOperation.java | 19 ++++++
.../fortress/core/util/AdminPermissionUtil.java | 62 +++++++++++++++-----
.../core/util/AdminPermissionUtilTest.java | 20 ++++++-
5 files changed, 120 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c2963f79/src/docker/apacheds-for-apache-fortress-tests/README.md
----------------------------------------------------------------------
diff --git a/src/docker/apacheds-for-apache-fortress-tests/README.md b/src/docker/apacheds-for-apache-fortress-tests/README.md
index 82e7470..d419452 100644
--- a/src/docker/apacheds-for-apache-fortress-tests/README.md
+++ b/src/docker/apacheds-for-apache-fortress-tests/README.md
@@ -1,3 +1,21 @@
+
+ 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.
+
ApacheDS for Apache Fortress tests
==================================
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c2963f79/src/docker/openldap-for-apache-fortress-tests/README.md
----------------------------------------------------------------------
diff --git a/src/docker/openldap-for-apache-fortress-tests/README.md b/src/docker/openldap-for-apache-fortress-tests/README.md
index fde5e3d..0a71961 100644
--- a/src/docker/openldap-for-apache-fortress-tests/README.md
+++ b/src/docker/openldap-for-apache-fortress-tests/README.md
@@ -1,3 +1,21 @@
+
+ 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.
+
OpenLDAP for Apache Fortress tests
==================================
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c2963f79/src/main/java/org/apache/directory/fortress/annotation/AdminPermissionOperation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/annotation/AdminPermissionOperation.java b/src/main/java/org/apache/directory/fortress/annotation/AdminPermissionOperation.java
index 3519aa3..913df16 100644
--- a/src/main/java/org/apache/directory/fortress/annotation/AdminPermissionOperation.java
+++ b/src/main/java/org/apache/directory/fortress/annotation/AdminPermissionOperation.java
@@ -1,3 +1,22 @@
+/*
+ * 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.
+ *
+ */
package org.apache.directory.fortress.annotation;
import java.lang.annotation.ElementType;
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c2963f79/src/main/java/org/apache/directory/fortress/core/util/AdminPermissionUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/AdminPermissionUtil.java b/src/main/java/org/apache/directory/fortress/core/util/AdminPermissionUtil.java
index 84762dc..18c9e4c 100644
--- a/src/main/java/org/apache/directory/fortress/core/util/AdminPermissionUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/AdminPermissionUtil.java
@@ -1,3 +1,22 @@
+/*
+ * 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.
+ *
+ */
package org.apache.directory.fortress.core.util;
@@ -25,40 +44,51 @@ public class AdminPermissionUtil
public static Map<String, List<String>> getPossibleAdminOperations()
{
Map<String, List<String>> adminOperations = new HashMap<String, List<String>>();
-
- adminOperations.put( AccessMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AccessMgrImpl.class ) );
- adminOperations.put( AdminMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AdminMgrImpl.class ) );
- adminOperations.put( AuditMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AuditMgrImpl.class ) );
- adminOperations.put( DelAdminMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( DelAdminMgrImpl.class ) );
- adminOperations.put( DelAccessMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( DelAccessMgrImpl.class ) );
- adminOperations.put( DelReviewMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( DelReviewMgrImpl.class ) );
- adminOperations.put( GroupMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( GroupMgrImpl.class ) );
- adminOperations.put( PwPolicyMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( PwPolicyMgrImpl.class ) );
- adminOperations.put( ReviewMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( ReviewMgrImpl.class ) );
-
+
+ adminOperations.put( AccessMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AccessMgrImpl
+ .class ) );
+ adminOperations.put( AdminMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AdminMgrImpl
+ .class ) );
+ adminOperations.put( AuditMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( AuditMgrImpl
+ .class ) );
+ adminOperations.put( DelAdminMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations(
+ DelAdminMgrImpl.class ) );
+ adminOperations.put( DelAccessMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations(
+ DelAccessMgrImpl.class ) );
+ adminOperations.put( DelReviewMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations(
+ DelReviewMgrImpl.class ) );
+ adminOperations.put( GroupMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( GroupMgrImpl
+ .class ) );
+ adminOperations.put( PwPolicyMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations(
+ PwPolicyMgrImpl.class ) );
+ adminOperations.put( ReviewMgrImpl.class.getCanonicalName(), AdminPermissionUtil.getOperations( ReviewMgrImpl
+ .class ) );
+
return adminOperations;
}
- private static List<String> getOperations( Class clazz )
+ private static List<String> getOperations(Class clazz)
{
List<String> operations = new ArrayList<String>();
-
+
final Method[] declaredMethods = clazz.getDeclaredMethods();
for ( final Method method : declaredMethods )
{
if ( method.isAnnotationPresent( AdminPermissionOperation.class ) )
{
AdminPermissionOperation annotation = method.getAnnotation( AdminPermissionOperation.class );
- if(annotation.operationName() != null && !annotation.operationName().isEmpty()){
+ if ( annotation.operationName() != null && !annotation.operationName().isEmpty() )
+ {
operations.add( annotation.operationName() );
}
- else{
+ else
+ {
operations.add( method.getName() );
}
}
}
-
+
return operations;
}
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c2963f79/src/test/java/org/apache/directory/fortress/core/util/AdminPermissionUtilTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/util/AdminPermissionUtilTest.java b/src/test/java/org/apache/directory/fortress/core/util/AdminPermissionUtilTest.java
index 44e5473..aa279ba 100644
--- a/src/test/java/org/apache/directory/fortress/core/util/AdminPermissionUtilTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/util/AdminPermissionUtilTest.java
@@ -1,4 +1,22 @@
-
+/*
+ * 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.
+ *
+ */
package org.apache.directory.fortress.core.util;
import java.util.List;