Core pr 6

Added new permission and rewritten logic base on last PR.