1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00
phorge-phorge/src/applications/conpherence/policyrule/ConpherenceThreadMembersPolicyRule.php
Bob Trahan 541e3d9e1c Conpherence - remove room vs message distinction as far as users are concerned
Summary:
Ref T8488, T8469, T8485.

This is done in regards to T8488 as far as users are concerned. There's still some classes, and etc. that should be re-named probably. T8469 and T8485 are basically moot now though.

Rather than having "Send Message" exposed, just expose "Create Room". Users get the full form. One change is "title" is now required.

This diff removes the concept of "isRoom" entirely.

Test Plan: Verifed a user with no conpherences had sensible data in both column view and full conpherence view. Created rooms with various policies and things worked well.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: chad, epriestley, Korvin

Maniphest Tasks: T8469, T8485, T8488

Differential Revision: https://secure.phabricator.com/D13351
2015-06-25 13:14:20 -07:00

46 lines
1,010 B
PHP

<?php
final class ConpherenceThreadMembersPolicyRule
extends PhabricatorPolicyRule {
public function getObjectPolicyKey() {
return 'conpherence.members';
}
public function getObjectPolicyName() {
return pht('Room Participants');
}
public function getPolicyExplanation() {
return pht('Participants in this room can take this action.');
}
public function getRuleDescription() {
return pht('room participants');
}
public function getObjectPolicyIcon() {
return 'fa-comments';
}
public function canApplyToObject(PhabricatorPolicyInterface $object) {
return ($object instanceof ConpherenceThread);
}
public function applyRule(
PhabricatorUser $viewer,
$value,
PhabricatorPolicyInterface $object) {
$viewer_phid = $viewer->getPHID();
if (!$viewer_phid) {
return false;
}
return (bool)$object->getParticipantIfExists($viewer_phid);
}
public function getValueControlType() {
return self::CONTROL_TYPE_NONE;
}
}