Fix front and backend views with new service variable setups

This commit is contained in:
Dane Everitt 2017-03-12 19:34:06 -04:00
parent 66e94dd7c0
commit fcadee7e67
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
14 changed files with 104 additions and 93 deletions

View file

@ -52,6 +52,36 @@ class ServerVariable extends Model
'variable_id' => 'integer',
];
/**
* Determine if variable is viewable by users.
*
* @return bool
*/
public function getUserCanViewAttribute()
{
return (bool) $this->variable->user_viewable;
}
/**
* Determine if variable is editable by users.
*
* @return bool
*/
public function getUserCanEditAttribute()
{
return (bool) $this->variable->user_editable;
}
/**
* Determine if variable is required.
*
* @return bool
*/
public function getRequiredAttribute()
{
return $this->variable->required;
}
/**
* Returns information about a given variables parent.
*