def show(Long id)
{
def activityLogInstance = ActivityLog.get(id)
// admins can access all logs
// filter by current org! because it is accessed by id
if (!SpringSecurityUtils.ifAllGranted("ROLE_ADMIN") &&
(!activityLogInstance || activityLogInstance.organizationUid != session.organization.uid))
{
flash.message = message(code:'activityLog.show.cantAccessLog')
redirect action:'index'
return
}
return [activityLogInstance: activityLogInstance]
}
New code: