def add_permission(self, name):
perm = self.find_permission(name)<EOL>if perm is None:<EOL><INDENT>try:<EOL><INDENT>perm = self.permission_model()<EOL>perm.name = name<EOL>self.get_session.add(perm)<EOL>self.get_session.commit()<EOL>return perm<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.error(c.LOGMSG_ERR_SEC_ADD_PERMISSION.format(str(e)))<EOL>self.get_session.rollback()<EOL><DEDENT><DEDENT>return perm<EOL>
Adds a permission to the backend, model permission

:param name:
    name of the permission: 'can_add','can_edit' etc...