Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Properties
plone.app.controlpanel.security.SecurityControlPanelAdapter Class Reference
Inheritance diagram for plone.app.controlpanel.security.SecurityControlPanelAdapter:
Inheritance graph
[legend]
Collaboration diagram for plone.app.controlpanel.security.SecurityControlPanelAdapter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_enable_self_reg
def set_enable_self_reg
def get_enable_user_pwd_choice
def set_enable_user_pwd_choice
def get_enable_user_folders
def set_enable_user_folders
def get_allow_anon_views_about
def set_allow_anon_views_about

Public Attributes

 pmembership
 portal
 context

Properties

 enable_self_reg = property(get_enable_self_reg, set_enable_self_reg)
 enable_user_pwd_choice
 enable_user_folders
 allow_anon_views_about

Detailed Description

Definition at line 49 of file security.py.


Constructor & Destructor Documentation

Definition at line 54 of file security.py.

00054 
00055     def __init__(self, context):
00056         super(SecurityControlPanelAdapter, self).__init__(context)
00057         pprop = getToolByName(context, 'portal_properties')
00058         self.pmembership = getToolByName(context, 'portal_membership')
00059         portal_url = getToolByName(context, 'portal_url')
00060         self.portal = portal_url.getPortalObject()
00061         self.context = pprop.site_properties

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Definition at line 113 of file security.py.

00113 
00114     def get_allow_anon_views_about(self):
00115         return self.context.site_properties.allowAnonymousViewAbout

Definition at line 62 of file security.py.

00062 
00063     def get_enable_self_reg(self):
00064         app_perms = self.portal.rolesOfPermission(permission='Add portal member')
00065         for appperm in app_perms:
00066             if appperm['name'] == 'Anonymous' and \
00067                appperm['selected'] == 'SELECTED':
00068                 return True
00069         return False

Definition at line 103 of file security.py.

00103 
00104     def get_enable_user_folders(self):
00105         return self.pmembership.getMemberareaCreationFlag()

Definition at line 87 of file security.py.

00087 
00088     def get_enable_user_pwd_choice(self):
00089         if self.portal.validate_email:
00090             return False
00091         else:
00092             return True

Definition at line 116 of file security.py.

00116 
00117     def set_allow_anon_views_about(self, value):
00118         self.context.site_properties.allowAnonymousViewAbout = value

Definition at line 70 of file security.py.

00070 
00071     def set_enable_self_reg(self, value):
00072         app_perms = self.portal.rolesOfPermission(permission='Add portal member')
00073         reg_roles = []
00074         for appperm in app_perms:
00075             if appperm['selected'] == 'SELECTED':
00076                 reg_roles.append(appperm['name'])
00077         if value == True and 'Anonymous' not in reg_roles:
00078             reg_roles.append('Anonymous')
00079         if value == False and 'Anonymous' in reg_roles:
00080             reg_roles.remove('Anonymous')
00081 
00082         self.portal.manage_permission('Add portal member', roles=reg_roles,
00083                                       acquire=0)

Definition at line 106 of file security.py.

00106 
00107     def set_enable_user_folders(self, value):
00108         self.pmembership.memberareaCreationFlag = value

Definition at line 93 of file security.py.

00093 
00094     def set_enable_user_pwd_choice(self, value):
00095         if value == True:
00096             self.portal.validate_email = False
00097         else:
00098             self.portal.validate_email = True


Member Data Documentation

Definition at line 60 of file security.py.

Definition at line 57 of file security.py.

Definition at line 59 of file security.py.


Property Documentation

Initial value:
property(get_allow_anon_views_about,
                                      set_allow_anon_views_about)

Definition at line 119 of file security.py.

Definition at line 84 of file security.py.

Initial value:
property(get_enable_user_folders,
                                   set_enable_user_folders)

Definition at line 109 of file security.py.

Initial value:
property(get_enable_user_pwd_choice,
                                      set_enable_user_pwd_choice)

Definition at line 99 of file security.py.


The documentation for this class was generated from the following file: