You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/01/28 01:55:58 UTC
svn commit: r1655205 - in /manifoldcf/trunk/connectors/filenet:
build-stub/src/main/java/com/filenet/api/constants/
build-stub/src/main/java/com/filenet/api/core/
build-stub/src/main/java/com/filenet/api/security/
implementation/src/main/java/org/apach...
Author: kwright
Date: Wed Jan 28 00:55:57 2015
New Revision: 1655205
URL: http://svn.apache.org/r1655205
Log:
More changes for CONNECTORS-1151.
Added:
manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java (with props)
manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java (with props)
Modified:
manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/core/Factory.java
manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Permission.java
manifoldcf/trunk/connectors/filenet/implementation/src/main/java/org/apache/manifoldcf/crawler/common/filenet/FilenetImpl.java
Added: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java?rev=1655205&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java (added)
+++ manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java Wed Jan 28 00:55:57 2015
@@ -0,0 +1,31 @@
+/* $Id$ */
+
+/**
+* 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 com.filenet.api.constants;
+
+/** Stub class to allow the connector to build fully.
+*/
+public class SecurityPrincipalType implements java.io.Serializable
+{
+ public static final int USER_AS_INT = 2000;
+
+ public int getValue()
+ {
+ return 0;
+ }
+}
Propchange: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/constants/SecurityPrincipalType.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/core/Factory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/core/Factory.java?rev=1655205&r1=1655204&r2=1655205&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/core/Factory.java (original)
+++ manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/core/Factory.java Wed Jan 28 00:55:57 2015
@@ -74,6 +74,14 @@ public class Factory
return null;
}
}
+
+ public static class Group
+ {
+ public static com.filenet.api.security.Group fetchInstance(com.filenet.api.core.Connection conn, String gname, PropertyFilter filter)
+ {
+ return null;
+ }
+ }
public static class ClassDescription
{
Added: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java?rev=1655205&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java (added)
+++ manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java Wed Jan 28 00:55:57 2015
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+/**
+* 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 com.filenet.api.security;
+
+/** Stub interface to allow the connector to build fully.
+*/
+public interface Group extends SecurityPrincipal
+{
+ public String get_Id();
+}
Propchange: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Group.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Permission.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Permission.java?rev=1655205&r1=1655204&r2=1655205&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Permission.java (original)
+++ manifoldcf/trunk/connectors/filenet/build-stub/src/main/java/com/filenet/api/security/Permission.java Wed Jan 28 00:55:57 2015
@@ -19,10 +19,12 @@
package com.filenet.api.security;
import com.filenet.api.core.*;
+import com.filenet.api.constants.SecurityPrincipalType;
/** Stub interface to allow the connector to build fully.
*/
public interface Permission extends EngineObject, DependentObject
{
public String get_GranteeName();
+ public SecurityPrincipalType get_GranteeType();
}
Modified: manifoldcf/trunk/connectors/filenet/implementation/src/main/java/org/apache/manifoldcf/crawler/common/filenet/FilenetImpl.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/implementation/src/main/java/org/apache/manifoldcf/crawler/common/filenet/FilenetImpl.java?rev=1655205&r1=1655204&r2=1655205&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/implementation/src/main/java/org/apache/manifoldcf/crawler/common/filenet/FilenetImpl.java (original)
+++ manifoldcf/trunk/connectors/filenet/implementation/src/main/java/org/apache/manifoldcf/crawler/common/filenet/FilenetImpl.java Wed Jan 28 00:55:57 2015
@@ -434,14 +434,25 @@ public class FilenetImpl extends Unicast
if (!gname.equals("#AUTHENTICATED-USERS"))
{
//System.out.println("Getting user "+gname);
- User usr = Factory.User.fetchInstance(conn, gname, null);
- if (usr != null)
- {
- // System.out.println("Docid "+docId+" view sid is "+usr.get_Id());
- if (atval == AccessType.ALLOW_AS_INT)
- rval.addAclValue(usr.get_Id());
- else if (atval == AccessType.DENY_AS_INT)
- rval.addDenyAclValue(usr.get_Id());
+ SecurityPrincipalType gtype = ap.get_GranteeType();
+ if (gtype.getValue() == SecurityPrincipalType.USER_AS_INT) {
+ User usr = Factory.User.fetchInstance(conn, gname, null);
+ if (usr != null) {
+ String sid = usr.get_Id();
+ if (atval == AccessType.ALLOW_AS_INT)
+ rval.addAclValue(sid);
+ else if (atval == AccessType.DENY_AS_INT)
+ rval.addDenyAclValue(sid);
+ }
+ } else {
+ Group grp = Factory.Group.fetchInstance(conn, gname, null);
+ if (grp != null) {
+ String sid = grp.get_Id();
+ if (atval == AccessType.ALLOW_AS_INT)
+ rval.addAclValue(sid);
+ else if (atval == AccessType.DENY_AS_INT)
+ rval.addDenyAclValue(sid);
+ }
}
}
else