Ejemplo n.º 1
0
 public function hasObjectPermission(ItemContract $subject, PermissionContract $permission, ItemContract $object)
 {
     // TODO: Implement hasObjectPermission() method.
     return Object::where('subject_type', $subject->getType())->where('subject_id', $subject->getId())->where('object_type', $object->getType())->where('object_id', $object->getId())->where('permission_id', $permission->getId())->first() ? true : false;
 }
Ejemplo n.º 2
0
 public function hasObjectRole(ItemContract $subject, RoleContract $role, ItemContract $object)
 {
     // TODO: Implement hasObjectRole() method.
     return Object::where('subject_type', $subject->getType())->where('subject_id', $subject->getId())->where('object_type', $object->getType())->where('object_id', $object->getId())->where('role_id', $role->getId())->first() ? true : false;
 }