/** * Construct a AVACL object with public read/write permissions * * @param read whether the public is allowed to read this object * @param write whether the public is allowed to write this object * @return */ public static AVACL parseACLWithPublicAccess(boolean read, boolean write) { AVACL acl = new AVACL(); acl.setPublicReadAccess(read); acl.setPublicWriteAccess(write); return acl; }
/** * Set whether users belonging to the role with the given roleName are allowed to read this * object. * * @param roleName The name of the role. * @param allowed Whether the given role can read this object. */ public void setRoleReadAccess(String roleName, boolean allowed) { allowRead(allowed, getRoleTagKey(roleName)); }
/** * Set whether users belonging to the role with the given roleName are allowed to write this * object. * * @param roleName The name of the role. * @param allowed Whether the given role can write this object. */ public void setRoleWriteAccess(String roleName, boolean allowed) { allowWrite(allowed, getRoleTagKey(roleName)); }
/** * Get whether users belonging to the given role are allowed to read this object. Even if this * returns false, the role may still be able to read it if a parent role has read access. The role * must already be saved on the server and its data must have been fetched in order to use this * method. * * @param role The role to check for access. * @return true if the role has read access. false otherwise. */ public boolean getRoleReadAccess(AVRole role) { String r = roleName(role.getName()); return getRoleReadAccess(r); }
/** * * Get whether users belonging to the given role are allowed to write this object. Even if this * returns false, the role may still be able to write it if a parent role has write access. The * role must already be saved on the server and its data must have been fetched in order to use * this method. * * @param role The role to check for access. * @return true if the role has write access. false otherwise. */ public boolean getRoleWriteAccess(AVRole role) { String r = roleName(role.getName()); return getRoleWriteAccess(r); }
private String getGetBucketParameters(String fileKey) { Map<String, Object> parameters = new HashMap<String, Object>(3); parameters.put("key", fileKey); parameters.put("name", parseFile.getName()); parameters.put("mime_type", parseFile.mimeType()); parameters.put("metaData", parseFile.getMetaData()); parameters.put("__type", AVFile.className()); if (parseFile.getACL() != null) { parameters.putAll(AVUtils.getParsedMap(parseFile.getACL().getACLMap())); } return AVUtils.restfulServerData(parameters); }
private void init() { objectId = ""; isDataReady = false; if (getPaasClientInstance().getDefaultACL() != null) { acl = new AVACL(getPaasClientInstance().getDefaultACL()); } running = false; }
/** * Set whether the public is allowed to read this object. */ public void setPublicReadAccess(boolean allowed) { allowRead(allowed, publicTag); }
/** * Set whether the public is allowed to write this object. */ public void setPublicWriteAccess(boolean allowed) { allowWrite(allowed, publicTag); }
public Map<String, Object> getACLMap() { Map<String, Object> aclMap = new HashMap<String, Object>(); aclMap.put(ACL_ATTR_NAME, getPermissionsById()); return aclMap; }
/** * Get whether the given user is *explicitly* allowed to read this object. Even if this returns * false, the user may still be able to access it if getPublicReadAccess returns true or a role * that the user belongs to has read access. * * @param user specified user * @return get whether the given user allowed to read this object */ public boolean getReadAccess(AVUser user) { return getReadAccess(user.getObjectId()); }
/** * Get whether the given user id is *explicitly* allowed to write this object. Even if this * returns false, the user may still be able to write it if getPublicWriteAccess returns true or a * role that the user belongs to has write access. */ public boolean getWriteAccess(AVUser user) { return getWriteAccess(user.getObjectId()); }
/** * Get whether users belonging to the given role are allowed to read this object. Even if this * returns false, the role may still be able to read it if a parent role has read access. The role * must already be saved on the server and its data must have been fetched in order to use this * method. * * @param role The role to check for access. * @return true if the role has read access. false otherwise. */ public boolean getRoleReadAccess(AVRole role) { String r = roleName(role.getName()); return getRoleReadAccess(r); }
/** * * Get whether users belonging to the given role are allowed to write this object. Even if this * returns false, the role may still be able to write it if a parent role has write access. The * role must already be saved on the server and its data must have been fetched in order to use * this method. * * @param role The role to check for access. * @return true if the role has write access. false otherwise. */ public boolean getRoleWriteAccess(AVRole role) { String r = roleName(role.getName()); return getRoleWriteAccess(r); }
private String getFileRequestParameters() { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("name", parseFile.getName()); parameters.put("mime_type", parseFile.mimeType()); parameters.put("metaData", parseFile.getMetaData()); parameters.put("__type", AVFile.className()); parameters.put("url", parseFile.getUrl()); if (parseFile.getACL() != null) { parameters.putAll(AVUtils.getParsedMap(parseFile.getACL().getACLMap())); } return AVUtils.restfulServerData(parameters); }
private void init() { objectId = ""; isDataReady = false; if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } running = false; }
/** * Set whether the given user is allowed to read this object. */ public void setReadAccess(String userId, boolean allowed) { allowRead(allowed, userId); }
/** * Set whether the given user id is allowed to write this object. */ public void setWriteAccess(String userId, boolean allowed) { allowWrite(allowed, userId); }
Map<String, Object> getACLMap() { Map<String, Object> aclMap = new HashMap<String, Object>(); aclMap.put("ACL", getPermissionsById()); return aclMap; }
/** * Get whether the given user id is *explicitly* allowed to read this object. Even if this returns * false, the user may still be able to access it if getPublicReadAccess returns true or a role * that the user belongs to has read access. */ public boolean getReadAccess(AVUser user) { return getReadAccess(user.getObjectId()); }