mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-02 21:52:19 +00:00
Monotone-Parent: d57385e5e0cf1d1b6dd18882212fa4b71679db3c
Monotone-Revision: 0653c8c5e81c2a2dd5096e25700dc8810e330dfa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-27T22:05:17 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
2007-04-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Contacts/UIxContactsUserRightsEditor.m
|
||||
([UIxContactsUserRightsEditor
|
||||
-setUserCanCreateObjects:userCanCreateObjects]): new subclass
|
||||
module to handle acls related to the address books. Partial
|
||||
implementation.
|
||||
|
||||
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder
|
||||
-setRoles:rolesforUser:uidforObjectAtPath:objectPathArray]): cache
|
||||
newly set roles.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
"Addressbook" = "Addressbook";
|
||||
"Addresses" = "Addresses";
|
||||
"Update" = "Update";
|
||||
"Cancel" = "Cancel";
|
||||
"Common" = "Common";
|
||||
"Contact editor" = "Contact editor";
|
||||
@@ -100,3 +101,14 @@
|
||||
= "You cannot subscribe to a folder that you own!";
|
||||
"Unable to subscribe to that folder!"
|
||||
= "Unable to subscribe to that folder!";
|
||||
|
||||
"User rights for:" = "User rights for:";
|
||||
|
||||
"This person can add cards to this addressbook."
|
||||
= "This person can add cards to this addressbook.";
|
||||
"This person can edit the cards of this addressbook."
|
||||
= "This person can edit the cards of this addressbook.";
|
||||
"This person can view the cards of this addressbook."
|
||||
= "This person can view the cards of this addressbook.";
|
||||
"This person can erase cards from this addressbook."
|
||||
= "This person can erase cards from this addressbook.";
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
"Address Books" = "Carnet d'adresses";
|
||||
"Addresses" = "Adresses";
|
||||
"Update" = "Mettre à jour";
|
||||
"Cancel" = "Annuler";
|
||||
"Common" = "Identité";
|
||||
"Contact editor" = "Éditer le contact";
|
||||
@@ -113,3 +114,14 @@
|
||||
= "Vous ne pouvez pas vous inscrire à un dossier qui vous appartient!";
|
||||
"Unable to subscribe to that folder!"
|
||||
= "Impossible de vous inscrire à ce dossier!";
|
||||
|
||||
"User rights for:" = "Autorisations pour :";
|
||||
|
||||
"This person can add cards to this addressbook."
|
||||
= "Cette personne peut ajouter des fiches à ce carnet d'adresses.";
|
||||
"This person can edit the cards of this addressbook."
|
||||
= "Cette personne peut éditer des fiches de ce carnet d'adresses.";
|
||||
"This person can view the cards of this addressbook."
|
||||
= "Cette personne peut visionner des fiches de ce carnet d'adresses.";
|
||||
"This person can erase cards from this addressbook."
|
||||
= "Cette personne peut effacer des fiches de ce carnet d'adresses.";
|
||||
|
||||
@@ -11,6 +11,7 @@ ContactsUI_LANGUAGES = English French
|
||||
ContactsUI_OBJC_FILES = \
|
||||
UIxContactsUserFolders.m \
|
||||
UIxContactsMailerSelection.m \
|
||||
UIxContactsUserRightsEditor.m \
|
||||
\
|
||||
ContactsUIProduct.m \
|
||||
UIxContactsFilterPanel.m \
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* UIxContactsUserRightsEditor.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXCONTACTSUSERRIGHTSEDITOR_H
|
||||
#define UIXCONTACTSUSERRIGHTSEDITOR_H
|
||||
|
||||
#import <UI/Common/UIxUserRightsEditor.h>
|
||||
|
||||
@interface UIxContactsUserRightsEditor : UIxUserRightsEditor
|
||||
|
||||
- (void) setUserCanCreateObjects: (BOOL) userCanCreateObjects;
|
||||
- (BOOL) userCanCreateObjects;
|
||||
|
||||
- (void) setUserCanEraseObjects: (BOOL) userCanEraseObjects;
|
||||
- (BOOL) userCanEraseObjects;
|
||||
|
||||
- (void) setUserCanEditObjects: (BOOL) userCanEditObjects;
|
||||
- (BOOL) userCanEditObjects;
|
||||
|
||||
- (void) setUserCanViewObjects: (BOOL) userCanViewObjects;
|
||||
- (BOOL) userCanViewObjects;
|
||||
|
||||
- (void) updateRights;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXCONTACTSUSERRIGHTSEDITOR_H */
|
||||
@@ -0,0 +1,111 @@
|
||||
/* UIxContactsUserRightsEditor.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "UIxContactsUserRightsEditor.h"
|
||||
|
||||
@implementation UIxContactsUserRightsEditor
|
||||
|
||||
- (void) setUserCanCreateObjects: (BOOL) userCanCreateObjects
|
||||
{
|
||||
if (userCanCreateObjects)
|
||||
[self appendRight: SOGoRole_ObjectCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectCreator];
|
||||
}
|
||||
|
||||
- (BOOL) userCanCreateObjects
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectCreator];
|
||||
}
|
||||
|
||||
- (void) setUserCanEraseObjects: (BOOL) userCanEraseObjects
|
||||
{
|
||||
if (userCanEraseObjects)
|
||||
[self appendRight: SOGoRole_ObjectEraser];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
- (BOOL) userCanEraseObjects
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
- (void) setUserCanEditObjects: (BOOL) userCanEditObjects
|
||||
{
|
||||
if (userCanEditObjects)
|
||||
[self appendRight: SOGoRole_ObjectEditor];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEditor];
|
||||
}
|
||||
|
||||
- (BOOL) userCanEditObjects
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectEditor];
|
||||
}
|
||||
|
||||
- (void) setUserCanViewObjects: (BOOL) userCanViewObjects
|
||||
{
|
||||
if (userCanViewObjects)
|
||||
[self appendRight: SOGoRole_ObjectViewer];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (BOOL) userCanViewObjects
|
||||
{
|
||||
return [userRights containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (void) updateRights
|
||||
{
|
||||
WORequest *request;
|
||||
|
||||
request = [context request];
|
||||
|
||||
if ([[request formValueForKey: @"ObjectCreator"] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectCreator];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectCreator];
|
||||
|
||||
if ([[request formValueForKey: @"ObjectEditor"] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectEditor];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEditor];
|
||||
|
||||
if ([[request formValueForKey: @"ObjectViewer"] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectViewer];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectViewer];
|
||||
|
||||
if ([[request formValueForKey: @"ObjectEraser"] length] > 0)
|
||||
[self appendRight: SOGoRole_ObjectEraser];
|
||||
else
|
||||
[self removeRight: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
@end
|
||||
+15
-16
@@ -76,7 +76,7 @@
|
||||
pageName = "UIxContactsListView";
|
||||
};
|
||||
new = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Add Documents, Images, and Files";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "new";
|
||||
};
|
||||
@@ -86,10 +86,19 @@
|
||||
actionName = "mailerContacts";
|
||||
};
|
||||
delete = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "SaveAcls"; /* a hack to force "owner" */
|
||||
pageName = "UIxContactsListView";
|
||||
actionName = "delete";
|
||||
};
|
||||
userRights = {
|
||||
protectedBy = "ReadAcls";
|
||||
pageName = "UIxContactsUserRightsEditor";
|
||||
};
|
||||
saveUserRights = {
|
||||
protectedBy = "SaveAcls";
|
||||
pageName = "UIxContactsUserRightsEditor";
|
||||
actionName = "saveUserRights";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -126,20 +135,20 @@
|
||||
SOGoContactGCSEntry = {
|
||||
methods = {
|
||||
view = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Access Contents Information";
|
||||
pageName = "UIxContactView";
|
||||
};
|
||||
delete = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Delete Objects";
|
||||
pageName = "UIxContactView";
|
||||
actionName = "delete";
|
||||
};
|
||||
edit = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxContactEditor";
|
||||
};
|
||||
save = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Change Images And Files";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "save";
|
||||
};
|
||||
@@ -148,11 +157,6 @@
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "write";
|
||||
};
|
||||
vcard = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactView";
|
||||
actionName = "vcard";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -181,11 +185,6 @@
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "write";
|
||||
};
|
||||
vcard = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactView";
|
||||
actionName = "vcard";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<!DOCTYPE var:component>
|
||||
<var:component xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:var="http://www.skyrix.com/od/binding"
|
||||
xmlns:const="http://www.skyrix.com/od/constant"
|
||||
xmlns:uix="OGo:uix"
|
||||
xmlns:label="OGo:label"
|
||||
xmlns:rsrc="OGo:url"
|
||||
className="UIxPageFrame"
|
||||
title="title"
|
||||
const:toolbar="none"
|
||||
const:popup="YES">
|
||||
<form id="userRightsForm" const:href="saveUserRights">
|
||||
<input type="hidden" name="uid" var:value="uid"/>
|
||||
<div class="title">
|
||||
<label><var:string label:value="User rights for:"/><br/>
|
||||
<span class="value"><var:string value="userDisplayName"/></span></label>
|
||||
</div>
|
||||
<div class="calendarUserRights">
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectCreator"
|
||||
var:checked="userCanCreateObjects"/><var:string
|
||||
label:value="This person can add cards to this addressbook."/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectEditor"
|
||||
var:checked="userCanEditObjects"/><var:string
|
||||
label:value="This person can edit the cards of this addressbook."/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectViewer"
|
||||
var:checked="userCanViewObjects"/><var:string
|
||||
label:value="This person can view the cards of this addressbook."/></label>
|
||||
<br/>
|
||||
<label><input type="checkbox" class="checkBox"
|
||||
const:name="ObjectEraser"
|
||||
var:checked="userCanEraseObjects"/><var:string
|
||||
label:value="This person can erase cards from this addressbook."/></label>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<input const:name="updateButton" id="updateButton"
|
||||
class="button" type="submit" label:value="Update"/>
|
||||
<input const:name="cancelButton" id="cancelButton"
|
||||
class="button" type="button" label:value="Cancel"/>
|
||||
</div>
|
||||
</form>
|
||||
</var:component>
|
||||
@@ -0,0 +1,49 @@
|
||||
DIV.title
|
||||
{ color: #000;
|
||||
vertical-align: bottom;
|
||||
padding-top: 15px;
|
||||
padding-left: 1em;
|
||||
height: 33px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #555; }
|
||||
|
||||
DIV.title SPAN.value
|
||||
{ margin-left: 1em;
|
||||
font-size: 18px;
|
||||
font-weight: bold; }
|
||||
|
||||
DIV.calendarUserRights
|
||||
{ margin: 1em;}
|
||||
|
||||
DIV.calendarUserRights > TABLE
|
||||
{ background-color: #fff;
|
||||
width: 45em;
|
||||
color: #999;
|
||||
border-collapse: collapse;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
border-top: 2px solid #222;
|
||||
border-left: 2px solid #222;
|
||||
-moz-border-top-colors: ThreeDShadow ThreeDDarkShadow transparent;
|
||||
-moz-border-left-colors: ThreeDShadow ThreeDDarkShadow transparent; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TR.permissions TH
|
||||
{ color: #00f;
|
||||
/* background-color: #ddd;
|
||||
*/ border-bottom: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TH
|
||||
{ width: 15em; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD.eventType
|
||||
{ width: 5em;
|
||||
text-align: right;
|
||||
border-right: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD
|
||||
{ text-align: center;
|
||||
border-top: 1px solid #cecbff; }
|
||||
|
||||
DIV.buttons
|
||||
{ text-align: right;
|
||||
margin: 1em; }
|
||||
@@ -0,0 +1,9 @@
|
||||
function onCancelClick(event) {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function initACLButtons() {
|
||||
$("cancelButton").addEventListener("click", onCancelClick, false);
|
||||
}
|
||||
|
||||
window.addEventListener("load", initACLButtons, false);
|
||||
Reference in New Issue
Block a user