Added permission functional (beta version)