Skip to main content

Content Access

Ways and reasons that allow a user to access a piece of content

Nowadays the roles that exist for the users are:

  • Superadmin: They are all people working at Publicala and have an email with @publica.la. They have more permissions than Admin users. Can manage the store and have access to the content.
  • Admin: They can manage the store and have access to the content. Are the intermediate users. They could be the tenants owners or clients of Publicala.
  • User: They can consume the content in the store. Are the final users. Are the clients of the tenants.

Keys that we use to identify the Reasons to Access are

LICENSE_PPU = 'license_ppu';
LICENSE_RETAIL = 'license_retail';
ADMIN_USER = 'administrator_user';
FREE_ISSUE = 'free_issue';
PREVIEW_ISSUE = 'preview_issue';
FREE_ACCESS = 'free_access';
BOUGHT_PUBLICATION = 'bought_publication';
CUSTOM_EXTERNAL_SCOPE = 'custom_external_scope';
SUBSCRIPTION = 'subscription';
LTI_ENTRY_POINT_FREE_ACCESS = 'lti_and_entry_point_free_access';

You can find it in this file: app/Support/ReasonsToAccessContent.php

The order how are checked the priority to know if a user can has access, is this

Take into account that the user can read the publication with a user registered or not, it means, we have an order to check if a user can access to the content depending on that.

When a user is not registered and/or is not authenticated

  1. [PREVIEW_ISSUE] A publication has a preview: A user can access a publication because it has a preview mode.

  2. [FREE_ISSUE] A publication is free: A user can access a publication because it is free.

When a user is registered and/or is authenticated

  1. [PREVIEW_ISSUE] A publication has a preview: A user can access a publication because it has a preview mode.

  2. [LICENSE_PPU] Has a license PPU: A user can access a publication through a loan of type PPU.

  3. [LICENSE_RETAIL] Has a license Retail: A user can access a publication with a Retail license that was bought.

  4. [ADMIN_USER] Is a administrator user: A user can access a publication because is a administrator of the platform.

  5. [FREE_ISSUE] A publication is free: A user can access a publication because it is free.

  6. [FREE_ACCESS] Has free access: A user can access a publication because has free access.

  7. [LTI_ENTRY_POINT_FREE_ACCESS] Has access by LTI: A user can access a publication because has an automatic free access by LTI.

  8. [BOUGHT_PUBLICATION] Bought a publication: A user can access a publication because bought a publication or it was asseigned manually.

  9. [CUSTOM_EXTERNAL_SCOPE] Has access with a custom external scope: A user can access a publication because has reading permissions.

  10. [SUBSCRIPTION] Has a subscription: A user can access a publication because has one or more subscriptions.

We can find these parts in the code where we check if a user can to hav access. The files we have now to do this are:

  • app/IssueUser.php in the userCanReadIssue method.
  • app/Http/Controllers/Reader/ReaderController.php in the show method.

X

Graph View