-# {{{ This object provides ACLs
-
-use vars qw/$RIGHTS/;
-$RIGHTS = {
- SeeClass => 'See that this class exists', #loc_pair
- CreateArticle => 'Create articles in this class', #loc_pair
- ShowArticle => 'See articles in this class', #loc_pair
- ShowArticleHistory => 'See changes to articles in this class', #loc_pair
- ModifyArticle => 'Modify or delete articles in this class', #loc_pair
- ModifyArticleTopics => 'Modify topics for articles in this class', #loc_pair
- AdminClass => 'Modify metadata and custom fields for this class', #loc_pair
- AdminTopics => 'Modify topic hierarchy associated with this class', #loc_pair
- ShowACL => 'Display Access Control List', #loc_pair
- ModifyACL => 'Create, modify and delete Access Control List entries', #loc_pair
- DeleteArticle => 'Delete articles in this class', #loc_pair
-};
-
-our $RIGHT_CATEGORIES = {
- SeeClass => 'Staff',
- CreateArticle => 'Staff',
- ShowArticle => 'General',
- ShowArticleHistory => 'Staff',
- ModifyArticle => 'Staff',
- ModifyArticleTopics => 'Staff',
- AdminClass => 'Admin',
- AdminTopics => 'Admin',
- ShowACL => 'Admin',
- ModifyACL => 'Admin',
- DeleteArticle => 'Staff',
-};
-
-# TODO: This should be refactored out into an RT::ACLedObject or something
-# stuff the rights into a hash of rights that can exist.
-
-# Tell RT::ACE that this sort of object can get acls granted
-$RT::ACE::OBJECT_TYPES{'RT::Class'} = 1;
-
-# TODO this is ripe for a refacor, since this is stolen from Queue
-__PACKAGE__->AddRights(%$RIGHTS);
-__PACKAGE__->AddRightCategories(%$RIGHT_CATEGORIES);
-
-=head2 AddRights C<RIGHT>, C<DESCRIPTION> [, ...]
-
-Adds the given rights to the list of possible rights. This method
-should be called during server startup, not at runtime.
-
-=cut
-
-sub AddRights {
- my $self = shift;
- my %new = @_;
- $RIGHTS = { %$RIGHTS, %new };
- %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
- map { lc($_) => $_ } keys %new);
-}
-
-=head2 AddRightCategories C<RIGHT>, C<CATEGORY> [, ...]
-
-Adds the given right and category pairs to the list of right categories. This
-method should be called during server startup, not at runtime.
-
-=cut
-
-sub AddRightCategories {
- my $self = shift if ref $_[0] or $_[0] eq __PACKAGE__;
- my %new = @_;
- $RIGHT_CATEGORIES = { %$RIGHT_CATEGORIES, %new };
-}
-
-=head2 AvailableRights
-
-Returns a hash of available rights for this object. The keys are the right names and the values are a description of what t
-he rights do
-
-=cut
-
-sub AvailableRights {
- my $self = shift;
- return ($RIGHTS);
-}
-
-sub RightCategories {
- return $RIGHT_CATEGORIES;
-}
-
-
-# }}}
-
+__PACKAGE__->AddRight( Staff => SeeClass => 'See that this class exists'); # loc
+__PACKAGE__->AddRight( Staff => CreateArticle => 'Create articles in this class'); # loc
+__PACKAGE__->AddRight( General => ShowArticle => 'See articles in this class'); # loc
+__PACKAGE__->AddRight( Staff => ShowArticleHistory => 'See changes to articles in this class'); # loc
+__PACKAGE__->AddRight( General => SeeCustomField => 'View custom field values' ); # loc
+__PACKAGE__->AddRight( Staff => ModifyArticle => 'Modify or delete articles in this class'); # loc
+__PACKAGE__->AddRight( Staff => ModifyArticleTopics => 'Modify topics for articles in this class'); # loc
+__PACKAGE__->AddRight( Staff => ModifyCustomField => 'Modify custom field values' ); # loc
+__PACKAGE__->AddRight( Admin => AdminClass => 'Modify metadata and custom fields for this class'); # loc
+__PACKAGE__->AddRight( Admin => AdminTopics => 'Modify topic hierarchy associated with this class'); # loc
+__PACKAGE__->AddRight( Admin => ShowACL => 'Display Access Control List'); # loc
+__PACKAGE__->AddRight( Admin => ModifyACL => 'Create, modify and delete Access Control List entries'); # loc
+__PACKAGE__->AddRight( Staff => DeleteArticle => 'Delete articles in this class'); # loc