'Check if library is accessible to user.
:param  library:                 library
:type   library:                 galaxy.model.Library
:param  check_accessible:        flag whether to check that user can access library
:type   check_accessible:        bool
:returns:   the original folder
:rtype:     LibraryFolder'

def secure(self, trans, library, check_accessible=True):

    if trans.user_is_admin():
        return library
    if check_accessible:
        library = self.check_accessible(trans, library)
    return library
