Firesphere\CSPHeaders\Models\SRI
Class \Firesphere\CSPHeaders\Models\SRI
Synopsis
class SRI
extends DataObject
implements
PermissionProvider
{
- // members
- private static string $table_name = 'SRI';
- private static string $singular_name = 'Subresource Integrity';
- private static string $plural_name = 'Subresource Integrities';
- private static bool $clear_sri_on_build = false;
- private static array $db = ;
- private static array $summary_fields = ;
- private static array $indexes = ;
- // methods
- public static SRI findOrCreate()
- public bool canCreate()
- public bool canEdit()
- public bool|int canDelete()
- public void onBeforeWrite()
- public void providePermissions()
- public void onAfterBuild()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Implements
- SilverStripe\Security\PermissionProvider
Members
private
- $clear_sri_on_build
—
Firesphere\CSPHeaders\Models\bool
If enabled (and using framework 4.7+) then a dev/build will delete all generated SRI and they will be regenerated when next required. - $db
- $indexes
- $plural_name
- $singular_name
- $summary_fields
- $table_name
Methods
public
- canCreate() — Created on request
- canDelete()
- canEdit() — If it needs to be edited, it should actually be recreated
- findOrCreate()
- onAfterBuild() — If configured, this deletes the Sub-resource integrity values on build of the database so they're regenerated next time that file is used.
- onBeforeWrite() — Generate the SRI for the file given
- providePermissions() — Return a map of permission codes to add to the dropdown shown in the Security section of the CMS.