108 |
108 |
109 class View(base.View): |
109 class View(base.View): |
110 """View methods for the User model. |
110 """View methods for the User model. |
111 """ |
111 """ |
112 |
112 |
113 def __init__(self, original_params=None, original_rights=None): |
113 def __init__(self, original_params=None): |
114 """Defines the fields and methods required for the base View class |
114 """Defines the fields and methods required for the base View class |
115 to provide the user with list, public, create, edit and delete views. |
115 to provide the user with list, public, create, edit and delete views. |
116 |
116 |
117 Params: |
117 Params: |
118 original_params: a dict with params for this View |
118 original_params: a dict with params for this View |
119 original_rights: a dict with right definitions for this View |
|
120 """ |
119 """ |
121 |
120 |
122 self._logic = soc.logic.models.user.logic |
121 self._logic = soc.logic.models.user.logic |
123 |
122 |
124 params = {} |
123 params = {} |
125 rights = {} |
|
126 |
124 |
127 params['name'] = "User" |
125 params['name'] = "User" |
128 params['name_short'] = "User" |
126 params['name_short'] = "User" |
129 params['name_plural'] = "Users" |
127 params['name_plural'] = "Users" |
130 params['url_name'] = "user" |
128 params['url_name'] = "user" |
151 |
149 |
152 params['edit_params'] = { |
150 params['edit_params'] = { |
153 self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED, |
151 self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED, |
154 } |
152 } |
155 |
153 |
156 rights['list'] = [helper.access.checkIsDeveloper] |
|
157 rights['delete'] = [helper.access.checkIsDeveloper] |
|
158 |
|
159 params = dicts.merge(original_params, params) |
154 params = dicts.merge(original_params, params) |
160 rights = dicts.merge(original_rights, rights) |
155 |
161 |
156 base.View.__init__(self, params=params) |
162 base.View.__init__(self, rights=rights, params=params) |
|
163 |
157 |
164 def editSelf(self, request, page_name=None, params=None, **kwargs): |
158 def editSelf(self, request, page_name=None, params=None, **kwargs): |
165 """Displays User self edit page for the entity specified by **kwargs. |
159 """Displays User self edit page for the entity specified by **kwargs. |
166 |
160 |
167 Args: |
161 Args: |