Package org.dspace.authorize

Examples of org.dspace.authorize.ResourcePolicy.update()


                                            rp.setRpName(name);
                                            rp.setRpDescription(description);
                                            rp.setStartDate(startDate);
                                            rp.setEndDate(endDate);

                                            rp.update();
                                        }
                                    }
                                }
                            }
                        }
View Full Code Here


        ResourcePolicy myPolicy = ResourcePolicy.create(context);
        myPolicy.setResource(c);
        myPolicy.setAction(Constants.READ);
        myPolicy.setGroup(anonymousGroup);
        myPolicy.update();

        context.addEvent(new Event(Event.CREATE, Constants.COMMUNITY, c.getID(),
                c.handle, c.getIdentifiers(context)));

        // if creating a top-level Community, simulate an ADD event at the Site.
View Full Code Here

            }
            ResourcePolicy rp = null;
            if( (rp= AuthorizeManager.createOrModifyPolicy(null, context, name, groupID, null, dateStartDate, org.dspace.core.Constants.READ, reason, b))==null){
                return STATUS_EDIT_POLICIES_DUPLICATED_POLICY;
            }
            rp.update();
            context.commit();
            return STATUS_EDIT_POLICIES;
        }
        // FORM: EditBitstreamPolicies SELECTED OPERATION: go to EditPolicyForm
        else if(org.dspace.submit.step.AccessStep.wasEditPolicyPressed(context, buttonPressed, subInfo)){
View Full Code Here

            Date dateStartDate = getEmbargoUntil(request);
            ResourcePolicy rp = null;
            if( (rp=AuthorizeManager.createOrModifyPolicy(null, context, name, groupID, null, dateStartDate, org.dspace.core.Constants.READ, reason, item))==null){
                return STATUS_DUPLICATED_POLICY;
            }
            rp.update();
            context.commit();
            return STATUS_COMPLETE;
        }

View Full Code Here

            Date dateStartDate = getEmbargoUntil(request);
            if( (resourcePolicy=AuthorizeManager.createOrModifyPolicy(resourcePolicy, context, name, groupID, null, dateStartDate, Constants.READ, reason, dso))==null){
                return EDIT_POLICY_STATUS_DUPLICATED_POLICY;
            }

            resourcePolicy.update();
            context.commit();
        }
        return STATUS_COMPLETE;
    }
View Full Code Here

                    .find(c, UIUtil.getIntParameter(request, "item_id"));

            AuthorizeUtil.authorizeManageItemPolicy(c, item);
            ResourcePolicy policy = ResourcePolicy.create(c);
            policy.setResource(item);
            policy.update();

            Group[] groups = Group.findAll(c, Group.NAME);
            EPerson[] epeople = EPerson.findAll(c, EPerson.EMAIL);

            // return to item permission page
View Full Code Here

                    "bundle_id"));

            AuthorizeUtil.authorizeManageBundlePolicy(c, bundle);
            ResourcePolicy policy = ResourcePolicy.create(c);
            policy.setResource(bundle);
            policy.update();

            Group[] groups = Group.findAll(c, Group.NAME);
            EPerson[] epeople = EPerson.findAll(c, EPerson.EMAIL);

            // return to item permission page
View Full Code Here

                    request, "bitstream_id"));

            AuthorizeUtil.authorizeManageBitstreamPolicy(c, bitstream);
            ResourcePolicy policy = ResourcePolicy.create(c);
            policy.setResource(bitstream);
            policy.update();

            Group[] groups = Group.findAll(c, Group.NAME);
            EPerson[] epeople = EPerson.findAll(c, EPerson.EMAIL);

            // return to item permission page
View Full Code Here

                    request, "collection_id"));

            AuthorizeUtil.authorizeManageCollectionPolicy(c, collection);
            ResourcePolicy policy = ResourcePolicy.create(c);
            policy.setResource(collection);
            policy.update();

            Group[] groups = Group.findAll(c, Group.NAME);
            EPerson[] epeople = EPerson.findAll(c, EPerson.EMAIL);

            // return to collection permission page
View Full Code Here

            if (policyId == -1)
            {
                // create new policy
                policy = ResourcePolicy.create(c);
                policy.setResource(collection);
                policy.update();
            }
            else
            {
                policy = ResourcePolicy.find(c, policyId);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.