~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/person.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-08-23 03:25:20 UTC
  • mfrom: (11403.2.4 bug-588773-charm)
  • Revision ID: launchpad@pqm.canonical.com-20100823032520-szdhfdt2pylrvy2w
[r=edwin-grubbs][ui=none][bug=588773] Fix the permissions for pillar
        editing by registry admins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1692
1692
    """Administer an `IPerson`."""
1693
1693
    schema = IPerson
1694
1694
    label = "Review person"
1695
 
    field_names = [
 
1695
    default_field_names = [
1696
1696
        'name', 'displayname',
1697
1697
        'personal_standing', 'personal_standing_reason']
1698
1698
    custom_widget(
1699
1699
        'personal_standing_reason', TextAreaWidget, height=5, width=60)
1700
1700
 
 
1701
    def setUpFields(self):
 
1702
        """Setup the normal fields from the schema, as appropriate.
 
1703
 
 
1704
        If not an admin (e.g. registry expert), remove the displayname field.
 
1705
        """
 
1706
        self.field_names = self.default_field_names[:]
 
1707
        admin = check_permission('launchpad.Admin', self.context)
 
1708
        if not admin:
 
1709
            self.field_names.remove('displayname')
 
1710
        super(PersonAdministerView, self).setUpFields()
 
1711
 
1701
1712
    @property
1702
1713
    def is_viewing_person(self):
1703
1714
        """Is the view showing an `IPerson`?