WIP: Epic/permissions 28
MR for insight into everything that has changed for permissions
changed milestone to %Permission #review
added Sprint::09/25 - Oldfashioned Owl Squad::Green scoped labels
mentioned in epic &28
added MR::Requires Changes scoped label
- Resolved by Brian Hatchet
- Last updated by Brian Hatchet
100 105 101 106 $exported = $item->export(...$this->exportArgs); 102 107 108 if ($item && Di::_()->get('Features\Manager')->has('permissions')) { 109 if ($item instanceof FeedSyncEntity && $item->getEntity()) { 110 $entity = $item->getEntity(); 111 } else { 112 $entity = $item; 113 } 114 115 /** @var Manager $permissionsManager */ 116 $permissionsManager = Di::_()->get('Permissions\Manager'); 117 $permissions = $permissionsManager->getList([ - Owner
Why are using a list function for a single entity?
- Developer
Because it's not a single entity per se. You can calculate the permissions for entire permissions at the manager level. We're just using it at the entity level to calculate single ones.
- Developer
I can name it whatever you'd like, just following our manager paradigm
- Resolved by Brian Hatchet
36 41 /** @var int */ 37 42 protected $timestamp; 38 43 44 /** @var int */ 45 protected $accessId; 46 39 47 /** @var string */ 40 48 protected $urn; 41 49 42 50 /** @var Entity */ 43 51 protected $entity; 44 52 53 public function setEntity($entity) - Owner
Code doc and type needed
50 69 { 51 70 return [ 52 71 'guid' => (string) $this->guid, 53 'owner_guid' => (string) $this->ownerGuid, 72 'owner_guid' => (string) $this->ownerGuid, 73 'access_id' => $this->accessId, - Owner
force as int?
37 public function __construct(User $user = null, Roles $roles = null, EntitiesBuilder $entitiesBuilder = null) 38 38 { 39 39 $this->entitiesBuilder = $entitiesBuilder ?: Di::_()->get('EntitiesBuilder'); 40 40 $this->roles = $roles ?: new Roles(); 41 41 $this->user = $user; 42 $this->isAdmin = $user->isAdmin(); 43 $this->isBanned = $user->isBanned(); 44 42 $this->groups = []; 45 43 $this->channels = []; 46 44 $this->entities = []; 45 $this->roles = $roles ?: new Roles(); 46 $this->user = $user; 47 if ($this->user) { 48 $this->isAdmin = $user->isAdmin(); 49 $this->isBanned = $user->isBanned(); 50 $this->channels[$user->getGuid()] = $user; - Owner
where is $channels var instantiated?
72 77 public function calculate(array $entities = []): void 73 78 { 74 79 foreach ($entities as $entity) { 75 $this->entities[$entity->getGUID()] = $this->getRoleForEntity($entity); 80 if ($entity) { 81 $this->entities[$entity->getGuid()] = $this->getRoleForEntity($entity); 82 } 76 83 } 77 84 } 78 85 79 86 private function getRoleForEntity($entity): Role - Owner
code doc needed
119 150 return $export; 120 151 } 121 152 153 /** 154 * Export the exact permissions for a calculated entity only 155 * 156 * @return array serialized individual permission for an entity 157 */ 158 public function exportPermission($guid): array - Owner
I'm having trouble with this function name, its not clear how it is different from
export()
function.
1446 1446 PRIMARY KEY (receiver_guid, time_sent) 1447 1447 ) WITH CLUSTERING ORDER BY (time_sent desc); 1448 1448 1449 CREATE TABLE minds.moderation_reports ( - Owner
Do we want this in this MR?
21 21 * @property-read string $enabled 22 22 */ 23 23 abstract class ElggEntity extends ElggData implements 24 Importable // Allow import of data - Owner
I can't tell what has been changed in this file.
added 18 commits
- d1b2d7a4...142d395f - 17 commits from branch
master
- 29e98b44 - Merge remote-tracking branch 'origin/master' into epic/permissions-28
- d1b2d7a4...142d395f - 17 commits from branch