code: public void chacc(String resourceName, String principalType, String principalName, String permissionString)
      throws CmsException {
  
          m_cms.lockResource(resourceName);
          if (I_CmsPrincipal.PRINCIPAL_GROUP.equalsIgnoreCase(principalType.trim())) {
              principalName = OpenCms.getImportExportManager().translateGroup(principalName);
          } else {
              principalName = OpenCms.getImportExportManager().translateUser(principalName);
          }
          m_cms.chacc(resourceName, principalType, principalName, permissionString);
      }
docs: Changes the access control for a given resource and a given principal(user/group).
  
  @param resourceName name of the resource
  @param principalType the type of the principal (group or user)
  @param principalName name of the principal
  @param permissionString the permissions in the format ((+|-)(r|w|v|c|i))*
  @throws CmsException if something goes wrong
  @see CmsObject#chacc(String, String, String, String)