Add type casting to roleid and resourceid