Example #1
0
 def create_access_policy(self, subjects):
     ap = dataoneTypes.AccessPolicy()
     ar = dataoneTypes.AccessRule()
     ar.subject = subjects
     ar.permission = ['changePermission']
     ap.allow.append(ar)
     return ap
Example #2
0
    if options.rightsHolder is None:
        oopts['rightsHolder'] = options.submitter
    else:
        oopts['rightsHolder'] = options.rightsHolder
    oopts['originMemberNode'] = options.originMemberNode
    oopts['authoritativeMemberNode'] = options.originMemberNode

    defrepl = dataoneTypes.ReplicationPolicy()
    if options.numberReplicas == 0:
        defrepl.replicationAllowed = False
    else:
        defrepl.replicationAllowed = True
        defrepl.numberReplicas = options.numberReplicas
    oopts['replicationPolicy'] = defrepl

    defap = dataoneTypes.AccessPolicy()
    ar = dataoneTypes.AccessRule()
    ar.permission = [
        dataoneTypes.Permission.read,
    ]
    ar.subject = [
        "public",
    ]
    defap.allow = [
        ar,
    ]
    ar = dataoneTypes.AccessRule()
    ar.permission = [
        dataoneTypes.Permission.write,
    ]
    ar.subject = [