All Projects → Euzee → permissionUtil

Euzee / permissionUtil

Licence: Apache-2.0 license
Simple permission helper

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to permissionUtil

Django Access
Django-Access - the application introducing dynamic evaluation-based instance-level (row-level) access rights control for Django
Stars: ✭ 47 (-26.56%)
Mutual labels:  runtime, permissions
startask-permissions
Is a library that helps to handle runtime permissions on Android, entirely written using Kotlin language.
Stars: ✭ 39 (-39.06%)
Mutual labels:  permissions, runtime-permissions
EffortlessPermissions
An Android permission library extending Google's EasyPermissions with convenient additions.
Stars: ✭ 84 (+31.25%)
Mutual labels:  permissions, runtime-permissions
dotty dict
Dictionary wrapper for quick access to deeply nested keys.
Stars: ✭ 67 (+4.69%)
Mutual labels:  helper, utils
Nest Access Control
Role and Attribute based Access Control for Nestjs 🔐
Stars: ✭ 562 (+778.13%)
Mutual labels:  helper, permissions
GoGPUtils
Enhance productivity and avoid to reinvent the wheel every time that you start a Go project
Stars: ✭ 29 (-54.69%)
Mutual labels:  helper, utils
advancedPermissionHandler
This Android library is for handle running time permissions in simplest way!
Stars: ✭ 13 (-79.69%)
Mutual labels:  helper, permissions
easypermissions-ktx
🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.
Stars: ✭ 324 (+406.25%)
Mutual labels:  permissions, runtime-permissions
openpai-runtime
Runtime for deep learning workload
Stars: ✭ 17 (-73.44%)
Mutual labels:  runtime
util
封装了一些Java常用的功能
Stars: ✭ 19 (-70.31%)
Mutual labels:  utils
inclavare-containers
A novel container runtime, aka confidential container, for cloud-native confidential computing and enclave runtime ecosystem.
Stars: ✭ 510 (+696.88%)
Mutual labels:  runtime
spree admin roles and access
Admin Roles And Access for Spree
Stars: ✭ 45 (-29.69%)
Mutual labels:  permissions
java-sdk
一些常用的java sdk和工具类(日期工具类,分布式锁,redis缓存,二叉树,反射工具类,线程池,对称/非对称/分段加解密,json序列化,http工具,雪花算法,字符串相似度,集合操作工具,xml解析,重试Retry工具类,Jvm监控等)
Stars: ✭ 26 (-59.37%)
Mutual labels:  utils
packetevents
PacketEvents is a powerful packet library. Our packet wrappers are efficient and easy to use. We support many protocol versions. (1.8+)
Stars: ✭ 235 (+267.19%)
Mutual labels:  utils
permission control system
This is an SDK which helps you to specify which user group (role) members have access to which actions in controllers.
Stars: ✭ 34 (-46.87%)
Mutual labels:  permissions
distribution
Siddhi streaming runtime and tooling distribution
Stars: ✭ 22 (-65.62%)
Mutual labels:  runtime
wazero
wazero: the zero dependency WebAssembly runtime for Go developers
Stars: ✭ 2,065 (+3126.56%)
Mutual labels:  runtime
agon
🦉 my golang utilities, log json config and other
Stars: ✭ 12 (-81.25%)
Mutual labels:  utils
lambda-runtime-pypy3.5
AWS Lambda Runtime for PyPy 3.5
Stars: ✭ 17 (-73.44%)
Mutual labels:  runtime
sweekt
🍭 Some sugar to sweeten Kotlin development.
Stars: ✭ 35 (-45.31%)
Mutual labels:  utils

Android Arsenal GitHub license API CircleCI

permissionUtil

A simple easy-to-use permission helper for Android. No need to handle result in onActivityResult and passing it to fragment or model. PermissionUtil can be used from any place with context only (Activity, Fragment,ViewModel).

//Easy to use
PermissionUtil.locationBoth(context, requestPermissionListener);

Callback

Added new CallbackBuilder so now you can build PermissionCallback with or without granted or denied calls. Also you can set resources for rationale explanation.

new CallbackBuilder()
                .onGranted(()->yourGrantedCall())
                .onDenied(()->yourDeniedCall())
                .withRationale(titleId,messageId)
                .build();

Simplified callback. Just override method that you need and that's it.

public abstract class ShortPerCallback implements PermissionCallback {

    @Override
    public void onPermissionGranted() {
    }

    @Override
    public void onPermissionDenied() {
    }
   
}

If you need to show rationale explanation - you may use CallbackBuilder or you need to override getRationaleTitleId() and getRationaleMessageId() of PermissionCallback class if you don't wan't to use builder . Dialog won't be shown if getRationaleMessageId() will return 0.

    // default implementation 
    
    int getRationaleTitleId() {
        return 0;
    }
    
    int getRationaleMessageId() {
        return 0;
    }

Actions

You can directly use prepared requests like :

PermissionUtil.locationFine(context, requestPermissionListener);
PermissionUtil.locationCoarse(context, requestPermissionListener);

Or you can request multiple permissions with your group :

PermissionUtil.checkGroup(context, requestPermissionListener,new String[]{Manifest.permission.READ_PHONE_STATE});

List of permissions that could be requested according to Dangerous permissions :

  • contactsRead
  • contactsWrite
  • contactsRW
  • calendarRead
  • calendarWrite
  • calendarRW
  • storageRead
  • storageWrite
  • storageRW
  • locationFine
  • locationCoarse
  • locationBoth
  • camera
  • microphone
  • phoneReadState
  • phoneCall
  • phoneReadCallLog
  • phoneWriteCallLog
  • phoneAddVoiceMail
  • phoneSip
  • phoneOutgoing
  • phoneAll
  • sensors
  • smsSend
  • smsReceive
  • smsRead
  • smsWap
  • smsMms
  • smsAll
  • checkGroup

Download

Download

repositories {
    // yo can use 
    mavenCentral() // or jcenter()
    
    //or direct link to repository or jitpack
    maven { url  "http://dl.bintray.com/euzee/Libs" } // or maven { url "https://jitpack.io" }
}
(with gradle plugin less then v3 use 'compile' instead of implementation) 
implementation 'com.github.euzee:permissionUtil:1.0.7'

License

Copyright 2017 Euzee, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].