Package org.dspace.authorize

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


            {
                ResourcePolicy r = ResourcePolicy.create(context);
                r.setResource(item);
                r.setGroup(group);
                r.setAction(Constants.READ);
                r.update();
            }
        }
    }
   
}
View Full Code Here


                        group = Group.find(context, Integer.parseInt(groupId));
                        policy.setGroup(group);
                    } catch (NumberFormatException ex) {
                    }
                }
                policy.update();
                return String.valueOf(policy.getID());
            } else {
                throw new EntityException("Not found", "Entity not found", 404);
            }
        } catch (SQLException ex) {
View Full Code Here

                        group = Group.find(context, Integer.parseInt(groupId));
                        policy.setGroup(group);
                    } catch (NumberFormatException ex) {
                    }
                }
                policy.update();
                return String.valueOf(policy.getID());
            } else {
                throw new EntityException("Not found", "Entity not found", 404);
            }
        } catch (SQLException ex) {
View Full Code Here

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

        // now create the default policies for submitted items
        myPolicy = ResourcePolicy.create(context);
        myPolicy.setResource(c);
        myPolicy.setAction(Constants.DEFAULT_ITEM_READ);
View Full Code Here

        // now create the default policies for submitted items
        myPolicy = ResourcePolicy.create(context);
        myPolicy.setResource(c);
        myPolicy.setAction(Constants.DEFAULT_ITEM_READ);
        myPolicy.setGroup(anonymousGroup);
        myPolicy.update();

        myPolicy = ResourcePolicy.create(context);
        myPolicy.setResource(c);
        myPolicy.setAction(Constants.DEFAULT_BITSTREAM_READ);
        myPolicy.setGroup(anonymousGroup);
View Full Code Here

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

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

        log.info(LogManager.getHeader(context, "create_collection",
                "collection_id=" + row.getIntColumn("collection_id"))
View Full Code Here

          AuthorizeManager.removeAllPolicies(context, logo);
          AuthorizeManager.addPolicies(context, policySet, logo);
      }
     
      // Perform the update action
      policy.update();
      context.commit();
     
      result.setContinue(true);
      result.setOutcome(true);
      if (added) result.setMessage(new Message("default","A new policy was created successfully"));
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

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.