[otrs-cvs] ITSMChangeManagement/Kernel/System/LinkObject ITSMChange.pm, 1.9, 1.9.2.1
"CVS commits notifications of OTRS.org" <[email protected]> Mon, 25 Mar 2013 18:55:15 +0000
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/ITSMChangeManagement/Kernel/System/LinkObject
In directory lancelot:/tmp/cvs-serv12283/Kernel/System/LinkObject
Modified Files:
Tag: rel-3_0
ITSMChange.pm
Log Message:
Improved permission checks in LinkObject.
Author: ub
Index: ITSMChange.pm
===================================================================
RCS file: /home/cvs/ITSMChangeManagement/Kernel/System/LinkObject/ITSMChange.pm,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -2 -u -d -r1.9 -r1.9.2.1
--- ITSMChange.pm 28 Oct 2010 12:54:30 -0000 1.9
+++ ITSMChange.pm 25 Mar 2013 18:55:09 -0000 1.9.2.1
@@ -1,5 +1,5 @@
# --
# Kernel/System/LinkObject/ITSMChange.pm - to link change objects
-# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id$
@@ -107,4 +107,43 @@
}
+=item ObjectPermission()
+
+checks read permission for a given object and UserID.
+
+ $Permission = $LinkObject->ObjectPermission(
+ Object => 'ITSMChange',
+ Key => 123,
+ UserID => 1,
+ );
+
+=cut
+
+sub ObjectPermission {
+ my ( $Self, %Param ) = @_;
+
+ # check needed stuff
+ for my $Argument (qw(Object Key UserID)) {
+ if ( !$Param{$Argument} ) {
+ $Self->{LogObject}->Log(
+ Priority => 'error',
+ Message => "Need $Argument!",
+ );
+ return;
+ }
+ }
+
+ # get config of change zoom frontend module
+ $Self->{Config} = $Self->{ConfigObject}->Get('ITSMChange::Frontend::AgentITSMChangeZoom');
+
+ # check permissions
+ my $Access = $Self->{ChangeObject}->Permission(
+ Type => $Self->{Config}->{Permission},
+ ChangeID => $Param{Key},
+ UserID => $Param{UserID},
+ );
+
+ return $Access;
+}
+
=item ObjectDescriptionGet()
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log