Download the PHP package wwwision/assetconstraints without Composer

On this page you can find all versions of the php package wwwision/assetconstraints. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package assetconstraints

Wwwision.AssetConstraints

Simple package to constraint access to Neos.Media assets based on tags, content type or asset collection

NOTE: The functionality of this package has been ported to the Neos Core with version 3.3 in the meantime

Usage

  1. Drop package into your (Neos) installation
  2. Add policies to your main package Policy.yaml
  3. Adjust Settings and NodeTypes configuration to your needs

Features

New Asset privileges:

This package comes with Entity Privileges allowing to restrict reading of Assets based on several attributes:

Restrict read access to Assets based on their media type

Policy.yaml:

Restrict read access to Assets based on Tag

Policy.yaml:

Restrict read access to Assets based on Asset Collection

Policy.yaml:

Of course you can combine the three matchers like:

Restrict read access to Tags based on Tag label

Policy.yaml:

Restrict read access to Asset Collections based on Collection title

Policy.yaml:

Custom Editors to set Asset Collection based on node properties:

When uploading new Assets using the Neos inspector, they will be added to the current site's default Asset Collection if one is configured in the Sites Management module.

Unfortunately this mechanism is not (yet) flexible enough to set the collection based on other characteristics (the currently selected node for example).

This package therefore adds two specialized Inspector editors for Asset/Image uploads that send the current node along with the upload-data to the server. Besides it hooks into the asset creation process (via AOP) to add the uploaded Asset to an Asset Collection based on the current node.

The default behavior is to grab the closest document node, evaluate it's "assetCollection" and adds the Asset to that collection if it succeeded.

This package also comes with a DataSource to allow for selecting the AssetCollection.

Adding "assetCollection" property to all Document nodes:

NodeTypes.yaml:

NOTE: Usually you don't want to add a property to all Document nodes (including shortcuts, ...) but to a more specific node type such as Your.Package:Page.

Adjusting the behavior of the AOP aspect:

As mentioned above, the default behavior of the AOP aspect is to check for a property called "assetCollection" in the closest Neos.Neos:Document node of the node the asset was uploaded to.

This can be adjusted via Settings. Imagine you have a custom node type Your.Package:MainPage that contains the target assetCollection in a property "collection":

Settings.yaml:

Example Policy

Given you have three "groups" and corresponding roles Some.Package:Group1Editor, Some.Package:Group2Editor and Some.Package:Group3Editor as well as an administrative role `Some.Package:Administrator.

Now, if you have three "Asset Collections" named group1, group2 and group3 the following Policy.yaml would restrict editors to only see collections and assets corresponding to their role:

Credits

The development of this package was kindly sponsored by Web Essentials!


All versions of assetconstraints with dependencies

PHP Build Version
Package Version
Requires neos/media Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wwwision/assetconstraints contains the following files

Loading the files please wait ....