Fix front and backend views with new service variable setups
This commit is contained in:
parent
66e94dd7c0
commit
fcadee7e67
14 changed files with 104 additions and 93 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue