@Override
  public boolean checkPermission(Class klass, UserIdentity identity) {
    RequiredPermission rp = (RequiredPermission) klass.getAnnotation(RequiredPermission.class);
    if (rp == null) {
      return true;
    }

    boolean result = authorizationProvider.checkPermission(rp.permission(), identity);

    return result;
  }
  @Override
  public boolean checkPermission(Method method, UserIdentity identity) {
    RequiredPermission rp = (RequiredPermission) method.getAnnotation(RequiredPermission.class);

    if (rp == null) {
      return checkPermission(method.getDeclaringClass(), identity);
    }

    boolean result = authorizationProvider.checkPermission(rp.permission(), identity);

    return result;
  }