SRI
extends DataObject
in package
implements
PermissionProvider
Class \Firesphere\CSPHeaders\Models\SRI
Table of Contents
Interfaces
- PermissionProvider
Properties
- $File : string
- $SRI : string
- $clear_sri_on_build : 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 : mixed
- $indexes : mixed
- $plural_name : mixed
- $singular_name : mixed
- $summary_fields : mixed
- $table_name : mixed
Methods
- canCreate() : bool
- Created on request
- canDelete() : bool|int
- canEdit() : bool
- If it needs to be edited, it should actually be recreated
- findOrCreate() : SRI
- onAfterBuild() : mixed
- 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() : mixed
- Generate the SRI for the file given
- providePermissions() : mixed
- Return a map of permission codes to add to the dropdown shown in the Security section of the CMS.
Properties
$File
public
string
$File
$SRI
public
string
$SRI
$clear_sri_on_build
If enabled (and using framework 4.7+) then a dev/build will delete all generated SRI and they will be regenerated when next required.
private
static bool
$clear_sri_on_build
= false
Tags
$db
private
static mixed
$db
= ['File' => \SilverStripe\ORM\FieldType\DBVarchar::class, 'SRI' => \SilverStripe\ORM\FieldType\DBVarchar::class]
$indexes
private
static mixed
$indexes
= ['File' => true]
$plural_name
private
static mixed
$plural_name
= 'Subresource Integrities'
$singular_name
private
static mixed
$singular_name
= 'Subresource Integrity'
$summary_fields
private
static mixed
$summary_fields
= ['File', 'LastEdited']
$table_name
private
static mixed
$table_name
= 'SRI'
Methods
canCreate()
Created on request
public
canCreate([null|Member $member = null ][, array<string|int, mixed> $context = array() ]) : bool
Parameters
- $member : null|Member = null
- $context : array<string|int, mixed> = array()
Return values
boolcanDelete()
public
canDelete([null|Member $member = null ]) : bool|int
Parameters
- $member : null|Member = null
Return values
bool|intcanEdit()
If it needs to be edited, it should actually be recreated
public
canEdit([null|Member $member = null ]) : bool
Parameters
- $member : null|Member = null
Return values
boolfindOrCreate()
public
static findOrCreate( $file) : SRI
Parameters
Tags
Return values
SRIonAfterBuild()
If configured, this deletes the Sub-resource integrity values on build of the database so they're regenerated next time that file is used.
public
onAfterBuild() : mixed
Note that this hook only exists in silverstripe-framework 4.7+
onBeforeWrite()
Generate the SRI for the file given
public
onBeforeWrite() : mixed
Tags
providePermissions()
Return a map of permission codes to add to the dropdown shown in the Security section of the CMS.
public
providePermissions() : mixed
array( 'VIEW_SITE' => 'View the site', );