private void init() { objectId = ""; isDataReady = false; if (getPaasClientInstance().getDefaultACL() != null) { acl = new AVACL(getPaasClientInstance().getDefaultACL()); } running = false; }
public AVFile() { super(); if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } }
private void init() { objectId = ""; isDataReady = false; if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } running = false; }
public AVFile() { super(); if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } }
/** * Constructs a new AVRole with the given name. If no default ACL has been specified, you must * provide an ACL for the role. * * @param name The name of the Role to create. */ public AVRole(String name) { super(className); this.name = name; acl = PaasClient.storageInstance().getDefaultACL(); if (acl == null) { throw new IllegalStateException( "There is no default ACL,please provide an ACL for the role with AVRole(String name, AVACL acl) constructor."); } this.put("name", name); }
/** * Constructs a new AVRole with the given name. If no default ACL has been specified, you must * provide an ACL for the role. * * @param name The name of the Role to create. */ public AVRole(String name) { super(className); this.name = name; acl = PaasClient.storageInstance().getDefaultACL(); if (acl == null) { throw new IllegalStateException( "There is no default ACL,please provide an ACL for the role with AVRole(String name, AVACL acl) constructor."); } this.put("name", name); }
/** * Sets a default ACL that will be applied to all AVObjects when they are created. * * @param acl The ACL to use as a template for all AVObjects created after setDefaultACL has been * called. This value will be copied and used as a template for the creation of new ACLs, * so changes to the instance after setDefaultACL() has been called will not be reflected * in new AVObjects. * @param withAccessForCurrentUser If true, the AVACL that is applied to newly-created AVObjects * will provide read and write access to the AVUser.getCurrentUser() at the time of * creation. If false, the provided ACL will be used without modification. If acl is null, * this value is ignored. */ public static void setDefaultACL(AVACL acl, boolean withAccessForCurrentUser) { if (acl == null) throw new IllegalArgumentException("Null ACL."); PaasClient.storageInstance().setDefaultACL(acl); if (withAccessForCurrentUser) { AVUser user = AVUser.getCurrentUser(); AVACL defaultACL = PaasClient.storageInstance().getDefaultACL(); defaultACL.setReadAccess(user, true); defaultACL.setWriteAccess(user, true); } }
/** * Sets a default ACL that will be applied to all AVObjects when they are created. * * @param acl The ACL to use as a template for all AVObjects created after setDefaultACL has been * called. This value will be copied and used as a template for the creation of new ACLs, * so changes to the instance after setDefaultACL() has been called will not be reflected * in new AVObjects. * @param withAccessForCurrentUser If true, the AVACL that is applied to newly-created AVObjects * will provide read and write access to the AVUser.getCurrentUser() at the time of * creation. If false, the provided ACL will be used without modification. If acl is * null, * this value is ignored. */ public static void setDefaultACL(AVACL acl, boolean withAccessForCurrentUser) { if (acl == null) throw new IllegalArgumentException("Null ACL."); PaasClient.storageInstance().setDefaultACL(acl); if (withAccessForCurrentUser) { AVUser user = AVUser.getCurrentUser(); AVACL defaultACL = PaasClient.storageInstance().getDefaultACL(); defaultACL.setReadAccess(user, true); defaultACL.setWriteAccess(user, true); } }