From: Nelson Ko <ne...@sy...> - 2015-03-03 06:25:36
|
In addition to the 2 Jonny mentioned (that check for specific field), there are the more general: $item->canView(); $item->canModify(); $item->canRemove(); all in lib/core/Tracker/Item.php On Mon, Mar 2, 2015 at 6:27 AM, Jonny Bradley <jo...@ti...> wrote: > > Hi Wolfgang, > > I think the best way to do this for tracker items is to use the > Tracker_Item class, like > > $item = Tracker_Item::fromId(42) > > The you can use these methods > > $item->canViewField($fid); > and > $item->canModifyField($fid); > > HTH > > jonny > > > > > > On 1 Mar 2015, at 17:34, wolfganga <wa...@us...> wrote: > > > > Hello, > > > > how can i check a trackeritem permission? (usecase: item is restricted > > by a category field). > > > > For tracker themselves that is easy: > > // works - check permission for a tracker > > $permObject = $tikilib->get_perm_object($trackerId, 'tracker'); > > > > But for a specific item i have not found anything. > > I tried soemthing like: > > // fails- check permission for a trackeritem > > $permObject = $tikilib->get_perm_object($itemId, 'trackeritem'); > > > > Of cause objectType 'trackeritem' is just a guess. After a bit of > > searching i found a list of objecttypes in > > $tikilib->get_permGroup_from_objectType($objectType). > > But there is nothing like 'item', so i am not even sure its implemented. > > > > On the otherhand: the trackeritem list respects restrictions by a > > category field. > > > > Thank you > > > > Wolfgang > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > > by Intel and developed in partnership with Slashdot Media, is your hub > for all > > things parallel software development, from weekly thought leadership > blogs to > > news, videos, case studies, tutorials and more. Take a look and join the > > conversation now. http://goparallel.sourceforge.net/ > > _______________________________________________ > > TikiWiki-devel mailing list > > Tik...@li... > > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel > > > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for > all > things parallel software development, from weekly thought leadership blogs > to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > TikiWiki-devel mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel > |