diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index 2daaa8abb..44e30bfa4 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -98,6 +98,10 @@ - (void) setOwner: (NSString *) newOwner; - (NSString *) ownerInContext: (id) _ctx; +/* a helper that determines whether access rights can be ignored on + an object */ +- (BOOL) ignoreRights; + /* looking up shared objects */ - (SOGoUserFolder *) lookupUserFolder; diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index da6547c84..f48aadd32 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -229,6 +229,25 @@ return owner; } +- (BOOL) ignoreRights +{ + SOGoUser *currentUser; + NSString *login; + BOOL ignoreRights; + + if (activeUserIsOwner) + ignoreRights = YES; + else + { + currentUser = [context activeUser]; + login = [currentUser login]; + ignoreRights = ([login isEqualToString: [self ownerInContext: context]] + || [currentUser isSuperUser]); + } + + return ignoreRights; +} + - (BOOL) isInPublicZone { if (!isInPublicZone)