'Check whether the user is permitted to access this item.
This check does not directly disable the item, but rather
sets the authorized-flag in the item which can then be used
by the renderer.'

def check_permission(self):

    has_role = current.auth.s3_has_role
    authorized = False
    restrict = self.restrict
    if restrict:
        for role in restrict:
            if has_role(role):
                authorized = True
                break
    else:
        authorized = True
    if (self.accessible_url() == False):
        authorized = False
    return authorized
